diff --git a/build.gradle.kts b/build.gradle.kts index 557b94b4..c9aea799 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -71,14 +71,10 @@ tasks.processResources { tasks.jar { dependsOn(internal) from({ internal.map { zipTree(it) } }) - - // TODO move into separate project - exclude("com") // `com.example` package } apiValidation { ignoredProjects.addAll(subprojects.map { it.name }) - ignoredPackages.add("com.example") nonPublicMarkers.add("org.jetbrains.annotations.ApiStatus\$Internal") } diff --git a/example/build.gradle.kts b/example/build.gradle.kts index a19d6343..b610de4e 100644 --- a/example/build.gradle.kts +++ b/example/build.gradle.kts @@ -18,7 +18,7 @@ dependencies { exclude(group = "org.jetbrains.kotlin") } - implementation(project(":")) + implementation(project(":example:common")) if (platform.isFabric) { val fabricApiVersion = when(platform.mcVersion) { diff --git a/example/common/build.gradle.kts b/example/common/build.gradle.kts new file mode 100644 index 00000000..1f228961 --- /dev/null +++ b/example/common/build.gradle.kts @@ -0,0 +1,23 @@ +import gg.essential.gradle.multiversion.StripReferencesTransform.Companion.registerStripReferencesAttribute + +plugins { + kotlin("jvm") + id("gg.essential.defaults") +} +repositories.mavenLocal() + +kotlin.jvmToolchain(8) + +val common = registerStripReferencesAttribute("common") { + excludes.add("net.minecraft") +} + +dependencies { + api(libs.kotlin.stdlib.jdk8) + + compileOnly(libs.versions.universalcraft.map { "gg.essential:universalcraft-1.8.9-forge:$it" }) { + attributes { attribute(common, true) } + } + + api(project(":")) +} diff --git a/src/main/java/com/example/examplemod/ComponentsGui.kt b/example/common/src/main/kotlin/com/example/examplemod/ComponentsGui.kt similarity index 100% rename from src/main/java/com/example/examplemod/ComponentsGui.kt rename to example/common/src/main/kotlin/com/example/examplemod/ComponentsGui.kt diff --git a/src/main/java/com/example/examplemod/ExampleGui.kt b/example/common/src/main/kotlin/com/example/examplemod/ExampleGui.kt similarity index 100% rename from src/main/java/com/example/examplemod/ExampleGui.kt rename to example/common/src/main/kotlin/com/example/examplemod/ExampleGui.kt diff --git a/src/main/java/com/example/examplemod/ExampleServerList.kt b/example/common/src/main/kotlin/com/example/examplemod/ExampleServerList.kt similarity index 100% rename from src/main/java/com/example/examplemod/ExampleServerList.kt rename to example/common/src/main/kotlin/com/example/examplemod/ExampleServerList.kt diff --git a/src/main/java/com/example/examplemod/ExamplesGui.kt b/example/common/src/main/kotlin/com/example/examplemod/ExamplesGui.kt similarity index 100% rename from src/main/java/com/example/examplemod/ExamplesGui.kt rename to example/common/src/main/kotlin/com/example/examplemod/ExamplesGui.kt diff --git a/src/main/java/com/example/examplemod/JavaTestGui.java b/example/common/src/main/kotlin/com/example/examplemod/JavaTestGui.java similarity index 100% rename from src/main/java/com/example/examplemod/JavaTestGui.java rename to example/common/src/main/kotlin/com/example/examplemod/JavaTestGui.java diff --git a/src/main/java/com/example/examplemod/KtTestGui.kt b/example/common/src/main/kotlin/com/example/examplemod/KtTestGui.kt similarity index 100% rename from src/main/java/com/example/examplemod/KtTestGui.kt rename to example/common/src/main/kotlin/com/example/examplemod/KtTestGui.kt diff --git a/settings.gradle.kts b/settings.gradle.kts index 7af485c9..dcfc092c 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -29,6 +29,7 @@ include(":example") project(":example").apply { buildFileName = "root.gradle.kts" } +include(":example:common") listOf( "1.8.9-forge", "1.12.2-forge",