Skip to content

Commit

Permalink
build: use kotlin dsl extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
Misat11 committed Dec 22, 2024
1 parent 496aafe commit 4dac7f0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew clean checkLicenses build shadowJar publish --stacktrace --warning-mode all
run: ./gradlew clean checkLicenses build publish --stacktrace --warning-mode all
env:
NEXUS_URL_RELEASE: ${{ secrets.NEXUS_URL_RELEASE }}
NEXUS_URL_SNAPSHOT: ${{ secrets.NEXUS_URL_SNAPSHOT }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew clean checkLicenses build shadowJar --stacktrace --warning-mode all
run: ./gradlew clean checkLicenses build --stacktrace --warning-mode all
27 changes: 13 additions & 14 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import io.freefair.gradle.plugins.lombok.LombokPlugin
import org.screamingsandals.gradle.builder.BuilderPlugin
import org.screamingsandals.gradle.builder.MavenUtilities
import org.screamingsandals.gradle.builder.Utilities
import org.screamingsandals.gradle.builder.JavadocUtilities
import org.screamingsandals.gradle.builder.*
import org.screamingsandals.gradle.slib.SLibPlugin
import org.screamingsandals.gradle.slib.SLibExtension

Expand All @@ -13,22 +10,26 @@ plugins {
alias(libs.plugins.lombok) apply false
}

defaultTasks("clean", "build", "shadowJar")
defaultTasks("clean", "build")

subprojects {
apply<JavaPlugin>()
apply<BuilderPlugin>()
apply<LombokPlugin>()

var mavenPublication: MavenPublication? = null
Utilities.configureLicenser(project)
if (project.name != "BedWars-protocol") {
configureShadowPlugin()
}

configureLicenser()
if (project.name != "BedWars-common") {
Utilities.configureSourceJarTasks(project)
mavenPublication = MavenUtilities.setupPublishing(project).publication
if (!version.toString().endsWith("-SNAPSHOT") && project.name == "BedWars-API") {
JavadocUtilities.configureJavadocTasks(project)
configureSourceJarTasks()
val buildJavadoc = !version.toString().endsWith("-SNAPSHOT") && project.name == "BedWars-API"
setupMavenPublishing(addSourceJar=true, addJavadocJar=buildJavadoc)
if (buildJavadoc) {
configureJavadocTasks()
}
MavenUtilities.setupMavenRepositoriesFromProperties(project)
setupMavenRepositoriesFromProperties()
}

repositories {
Expand Down Expand Up @@ -88,8 +89,6 @@ subprojects {
}
}

Utilities.configureShadowPlugin(project, mavenPublication)

configurations.all {
// Check for updates every build
resolutionStrategy.cacheChangingModulesFor(0, "seconds")
Expand Down

0 comments on commit 4dac7f0

Please sign in to comment.