Skip to content

Commit

Permalink
Use buildSrc to organize project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
shitzuu committed Aug 12, 2024
1 parent e2747a1 commit 3a484fe
Show file tree
Hide file tree
Showing 21 changed files with 116 additions and 28 deletions.
14 changes: 13 additions & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 0 additions & 26 deletions build.gradle.kts

This file was deleted.

14 changes: 14 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
plugins {
`kotlin-dsl`
}

group = "dev.shiza"
version = "1.0.0-SNAPSHOT"

repositories {
gradlePluginPortal()
}

dependencies {
implementation(kotlin("script-runtime"))
}
20 changes: 20 additions & 0 deletions buildSrc/src/main/kotlin/dew-java.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
plugins {
`java-library`
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

sourceSets {
main {
java.setSrcDirs(listOf("src"))
resources.setSrcDirs(emptyList<String>())
}
test {
java.setSrcDirs(emptyList<String>())
resources.setSrcDirs(emptyList<String>())
}
}
34 changes: 34 additions & 0 deletions buildSrc/src/main/kotlin/dew-publish.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
plugins {
`java-library`
`maven-publish`
}

group = "dev.shiza"
version = "1.0.0-SNAPSHOT"

java {
withSourcesJar()
}

publishing {
repositories {
mavenLocal()
}
}

interface DewPublishExtension {
var artifactId: String
}

val extension = extensions.create<DewPublishExtension>("dewPublish")

afterEvaluate {
publishing {
publications {
create<MavenPublication>("maven") {
artifactId = extension.artifactId
from(project.components["java"])
}
}
}
}
7 changes: 7 additions & 0 deletions buildSrc/src/main/kotlin/dew-repositories.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
plugins {
`java-library`
}

repositories {
mavenCentral()
}
12 changes: 12 additions & 0 deletions dew-common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
plugins {
`dew-java`
`dew-publish`
`dew-repositories`
}

group = "dev.shiza"
version = "1.0.0-SNAPSHOT"

dewPublish {
artifactId = "dew"
}
File renamed without changes.
9 changes: 9 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#not handy tbh
#org.gradle.vfs.watch=true
org.gradle.parallel=true
org.gradle.daemon=true
org.gradle.caching=true
org.gradle.jvmargs=-Xmx2048M
#wait for https://github.com/gradle/gradle/issues/24040
#org.gradle.unsafe.configuration-cache=true
kotlin.stdlib.default.dependency=false
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
rootProject.name = "dew"

include(":dew-common")

0 comments on commit 3a484fe

Please sign in to comment.