-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use source set configuration from helper
- Loading branch information
1 parent
be657a0
commit e149643
Showing
2 changed files
with
17 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,29 @@ | ||
plugins { | ||
idea | ||
id ("com.github.minecraftschurlimods.helperplugin") | ||
} | ||
|
||
sourceSets.register("api") | ||
|
||
val neo by configurations.creating | ||
configurations.implementation.configure { extendsFrom(neo) } | ||
configurations.named("apiCompileOnly").configure { extendsFrom(neo) } | ||
helper.withApiSourceSet() | ||
|
||
dependencies { | ||
neo(helper.neoforge()) | ||
implementation(sourceSets.api.output) | ||
implementation(helper.neoforge()) | ||
compileOnly("org.jetbrains:annotations:23.0.0") | ||
"apiCompileOnly"("org.jetbrains:annotations:23.0.0") | ||
} | ||
|
||
tasks.jar { | ||
from(sourceSets.main.output) | ||
from(sourceSets.api.output) | ||
} | ||
|
||
tasks.named<Jar>("sourcesJar") { | ||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE | ||
from(sourceSets.main.allSource) | ||
from(sourceSets.api.allSource) | ||
} | ||
|
||
val apiJar: TaskProvider<Jar> by tasks.registering(Jar::class) { | ||
dependsOn(tasks.named("apiClasses")) | ||
archiveClassifier.set("api") | ||
from(sourceSets.api.allSource) | ||
from(sourceSets.api.output) | ||
} | ||
|
||
artifacts.archives(apiJar) | ||
|
||
helper.publication.apply { | ||
artifact(apiJar) | ||
pom { | ||
organization { | ||
name = "Minecraftschurli Mods" | ||
url = "https://github.com/MinecraftschurliMods" | ||
} | ||
developers { | ||
developer { | ||
id = "minecraftschurli" | ||
name = "Minecraftschurli" | ||
email = "[email protected]" | ||
organization = "Minecraftschurli Mods" | ||
organizationUrl = "https://github.com/Minecraftschurli" | ||
timezone = "Europe/Vienna" | ||
} | ||
helper.publication.pom { | ||
organization { | ||
name = "Minecraftschurli Mods" | ||
url = "https://github.com/MinecraftschurliMods" | ||
} | ||
developers { | ||
developer { | ||
id = "minecraftschurli" | ||
name = "Minecraftschurli" | ||
email = "[email protected]" | ||
organization = "Minecraftschurli Mods" | ||
organizationUrl = "https://github.com/Minecraftschurli" | ||
timezone = "Europe/Vienna" | ||
} | ||
} | ||
} | ||
|
||
val SourceSetContainer.api: Provider<SourceSet> get() = named("api") | ||
val Provider<SourceSet>.allSource: Provider<SourceDirectorySet> get() = map { it.allSource } | ||
val Provider<SourceSet>.output: Provider<SourceSetOutput> get() = map { it.output } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters