-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Merge package-infos, jar-sets, and transitive-source-sets plugins - Move publishing logic into JarTaskSet - Do not eagerly add all jarsets to assemble - Significantly reduces build times - Add separate helper method for creating outgoing jarsets
- Loading branch information
Showing
13 changed files
with
86 additions
and
149 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
27 changes: 20 additions & 7 deletions
27
buildSrc/src/main/kotlin/com/jozufozu/gradle/jarset/JarSetExtension.kt
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,16 +1,29 @@ | ||
package com.jozufozu.gradle.jarset | ||
|
||
import net.fabricmc.loom.task.RemapJarTask | ||
import net.fabricmc.loom.task.RemapSourcesJarTask | ||
import org.gradle.api.Project | ||
import org.gradle.api.tasks.SourceSet | ||
import org.gradle.api.tasks.SourceSetContainer | ||
import org.gradle.kotlin.dsl.the | ||
import org.gradle.jvm.tasks.Jar | ||
import org.gradle.kotlin.dsl.named | ||
import org.gradle.kotlin.dsl.provideDelegate | ||
|
||
open class JarSetExtension(val project: Project) { | ||
fun createJars(name: String): JarTaskSet { | ||
return createJars(name, project.the<SourceSetContainer>().named(name).get()) | ||
open class JarSetExtension(private val project: Project) { | ||
fun create(name: String, vararg sourceSetSet: SourceSet): JarTaskSet { | ||
return JarTaskSet.create(project, name, *sourceSetSet) | ||
} | ||
|
||
fun createJars(name: String, vararg sourceSetSet: SourceSet): JarTaskSet { | ||
return JarTaskSet.create(project, name, *sourceSetSet) | ||
fun outgoing(name: String, vararg sourceSetSet: SourceSet): JarTaskSet { | ||
return JarTaskSet.create(project, name, *sourceSetSet).also { it.createOutgoingConfiguration() } | ||
} | ||
|
||
val mainSet: JarTaskSet by lazy { | ||
val jarTask = project.tasks.named<Jar>("jar") | ||
val remapJarTask = project.tasks.named<RemapJarTask>("remapJar") | ||
val sourcesJarTask = project.tasks.named<Jar>("sourcesJar") | ||
val remapSourcesJarTask = project.tasks.named<RemapSourcesJarTask>("remapSourcesJar") | ||
val javadocJarTask = project.tasks.named<Jar>("javadocJar") | ||
|
||
JarTaskSet(project, "main", jarTask, remapJarTask, sourcesJarTask, remapSourcesJarTask, javadocJarTask) | ||
} | ||
} |
10 changes: 0 additions & 10 deletions
10
buildSrc/src/main/kotlin/com/jozufozu/gradle/jarset/JarSetPlugin.kt
This file was deleted.
Oops, something went wrong.
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
10 changes: 0 additions & 10 deletions
10
buildSrc/src/main/kotlin/com/jozufozu/gradle/nullability/PackageInfosPlugin.kt
This file was deleted.
Oops, something went wrong.
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
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
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
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
10 changes: 0 additions & 10 deletions
10
buildSrc/src/main/kotlin/com/jozufozu/gradle/transitive/TransitiveSourceSetsPlugin.kt
This file was deleted.
Oops, something went wrong.
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
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
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