diff --git a/.github/workflows/archrules.yml b/.github/workflows/archrules.yml new file mode 100644 index 00000000..eab2112d --- /dev/null +++ b/.github/workflows/archrules.yml @@ -0,0 +1,42 @@ +# action for evaluating archrules on a single project repo +name: Nebula ArchRules +on: + push: + branches: + - 'main' + pull_request: + +jobs: + buildmultijdk: + runs-on: ubuntu-latest + name: ArchRules + steps: + - uses: actions/checkout@v6 + - name: Setup git user + run: | + git config --global user.name "Nebula Plugin Maintainers" + git config --global user.email "nebula-plugins-oss@netflix.com" + - name: Set up JDKs + uses: actions/setup-java@v5 + with: + distribution: 'zulu' + java-version: | + 17 + 21 + java-package: jdk + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v5 + with: + cache-overwrite-existing: true + build-scan-publish: true + build-scan-terms-of-use-url: 'https://gradle.com/terms-of-service' + build-scan-terms-of-use-agree: 'yes' + - name: Gradle run archrules + run: ./gradlew --stacktrace archRulesConsoleReport archRulesMarkdownReport + - name: Arch Rule Reports step summary + run: cat build/reports/archrules/report.md > $GITHUB_STEP_SUMMARY + - name: PR Comment + if: github.event_name == 'pull_request' + run: gh pr comment ${{ github.event.number }} --edit-last --create-if-none -b "[ArchRules report](${{ github.server.url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" + env: + GH_TOKEN: ${{ github.token }} \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b65b5f20..4219a5dd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,10 +31,13 @@ jobs: 21 ${{ matrix.java }} java-package: jdk -# - name: Setup Gradle -# uses: gradle/actions/setup-gradle@v5 -# with: -# cache-overwrite-existing: true + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v5 + with: + cache-overwrite-existing: true + build-scan-publish: true + build-scan-terms-of-use-url: 'https://gradle.com/terms-of-service' + build-scan-terms-of-use-agree: 'yes' - name: Gradle build run: ./gradlew --stacktrace build env: diff --git a/.github/workflows/refresh-locks.yml b/.github/workflows/refresh-locks.yml new file mode 100644 index 00000000..a03bf3d0 --- /dev/null +++ b/.github/workflows/refresh-locks.yml @@ -0,0 +1,42 @@ +name: Refresh Dependency Locks +on: + workflow_dispatch: + schedule: + - cron: "0 0 * * 1" + +jobs: + refresh-locks: + runs-on: ubuntu-latest + name: Refresh Dependency Locks + steps: + - uses: actions/checkout@v6 + - name: Setup git user + run: | + git config --global user.name "Nebula Plugin Maintainers" + git config --global user.email "nebula-plugins-oss@netflix.com" + - name: Set up JDKs + uses: actions/setup-java@v4 + with: + distribution: 'zulu' + java-version: | + 17 + 21 + java-package: jdk + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v5 + with: + cache-overwrite-existing: true + build-scan-publish: true + build-scan-terms-of-use-url: 'https://gradle.com/terms-of-service' + build-scan-terms-of-use-agree: 'yes' + - name: Gradle build + run: ./gradlew resolve --write-locks --refresh-dependencies --stacktrace + - name: Commit + run: | + git checkout -b dependency-update + git commit -a -m "Update dependencies" + git push -u origin dependency-update + - name: Open PR + run: gh pr create -B main -H dependency-update --title 'Update dependencies' --body 'Created by Github action' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a451f292..5ed71444 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,10 +35,13 @@ jobs: 17 21 java-package: jdk -# - name: Setup Gradle -# uses: gradle/actions/setup-gradle@v5 -# with: -# cache-overwrite-existing: true + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v5 + with: + cache-overwrite-existing: true + build-scan-publish: true + build-scan-terms-of-use-url: 'https://gradle.com/terms-of-service' + build-scan-terms-of-use-agree: 'yes' - name: Verify plugin publication if: (!contains(github.ref, '-rc.')) run: ./gradlew --stacktrace -Prelease.useLastTag=true final publishPlugin --validate-only -x check diff --git a/build.gradle b/build.gradle index 4b77b30d..6104b4e0 100644 --- a/build.gradle +++ b/build.gradle @@ -17,8 +17,7 @@ import org.gradle.api.attributes.plugin.GradlePluginApiVersion * */ plugins { - id 'com.netflix.nebula.plugin-plugin' version '22.0.2' - id 'java-library' + id 'com.netflix.nebula.plugin-plugin' } description = 'Provides a task similar to Tar and Zip for constructing RPM and DEB package files.' @@ -32,10 +31,6 @@ contacts { } } -dependencyLock { - includeTransitives = true -} - configurations.all { resolutionStrategy { force 'org.bouncycastle:bcpg-jdk15on:1.62' @@ -59,6 +54,7 @@ dependencies { implementation 'com.bmuschko:gradle-docker-plugin:10.0.0' testImplementation 'com.github.stefanbirkner:system-rules:1.19.0' + testImplementation("org.spockframework:spock-junit4:2.4-groovy-4.0") } def javaApiUrl = 'http://docs.oracle.com/javase/1.6.0/docs/api/' @@ -165,3 +161,9 @@ gradlePlugin { } } } + +tasks.wrapper { + distributionType = Wrapper.DistributionType.BIN + gradleVersion = "9.5.1" + distributionSha256Sum = "bafc141b619ad6350fd975fc903156dd5c151998cc8b058e8c1044ab5f7b031f" +} \ No newline at end of file diff --git a/gradle.lockfile b/gradle.lockfile index df3e5fdb..b92e7ddb 100644 --- a/gradle.lockfile +++ b/gradle.lockfile @@ -2,42 +2,49 @@ # Manual edits can break the build and are not advised. # This file is expected to be part of source control. cglib:cglib-nodep:3.2.2=integTestRuntimeClasspath,testRuntimeClasspath -com.bmuschko:gradle-docker-plugin:10.0.0=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.bmuschko:gradle-docker-plugin:10.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.luben:zstd-jni:1.5.6-3=integTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath -com.github.stefanbirkner:system-rules:1.19.0=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.netflix.nebula:nebula-test:11.0.0=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -commons-codec:commons-codec:1.17.0=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -commons-io:commons-io:2.16.1=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.airlift:aircompressor:0.27=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -javax.inject:javax.inject:1=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -junit:junit-dep:4.11=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -junit:junit:4.13.2=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.apache.ant:ant-launcher:1.10.15=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.apache.ant:ant:1.10.15=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.apache.commons:commons-compress:1.26.2=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.apache.commons:commons-lang3:3.14.0=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.apache.groovy:groovy:4.0.4=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.apache.maven:maven-archiver:3.6.3=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.apiguardian:apiguardian-api:1.1.2=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.bouncycastle:bcpg-jdk15on:1.62=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.bouncycastle:bcprov-jdk15on:1.62=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.codehaus.plexus:plexus-archiver:4.10.0=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.codehaus.plexus:plexus-interpolation:1.27=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.codehaus.plexus:plexus-io:3.5.0=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.hamcrest:hamcrest-core:1.3=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.hamcrest:hamcrest:2.2=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-commons:1.13.1=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-engine:1.13.1=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-launcher:1.13.1=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.github.stefanbirkner:system-rules:1.19.0=testCompileClasspath,testRuntimeClasspath +com.netflix.nebula:nebula-test:12.4.3=testCompileClasspath,testRuntimeClasspath +commons-codec:commons-codec:1.17.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +commons-io:commons-io:2.16.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +io.airlift:aircompressor:0.27=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath +javax.inject:javax.inject:1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +junit:junit-dep:4.11=testCompileClasspath,testRuntimeClasspath +junit:junit:4.13.2=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.3=testCompileClasspath,testRuntimeClasspath +org.apache.ant:ant-launcher:1.10.15=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.apache.ant:ant:1.10.15=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.apache.commons:commons-compress:1.26.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.apache.commons:commons-lang3:3.14.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.apache.groovy:groovy-bom:4.0.29=testCompileClasspath,testRuntimeClasspath +org.apache.groovy:groovy:4.0.29=testCompileClasspath,testRuntimeClasspath +org.apache.maven:maven-archiver:3.6.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath +org.assertj:assertj-core:3.27.7=testCompileClasspath,testRuntimeClasspath +org.bouncycastle:bcpg-jdk15on:1.62=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.bouncycastle:bcprov-jdk15on:1.62=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.plexus:plexus-archiver:4.10.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.plexus:plexus-interpolation:1.27=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.plexus:plexus-io:3.5.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.hamcrest:hamcrest-core:1.3=testCompileClasspath,testRuntimeClasspath +org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-commons:1.14.4=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-engine:1.14.4=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-launcher:1.14.4=testCompileClasspath,testRuntimeClasspath +org.junit:junit-bom:5.14.4=testCompileClasspath,testRuntimeClasspath org.objenesis:objenesis:2.4=integTestRuntimeClasspath,testRuntimeClasspath -org.opentest4j:opentest4j:1.3.0=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.redline-rpm:redline:1.2.10=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:1.7.36=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.sonatype.plexus:plexus-cipher:1.4=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.sonatype.plexus:plexus-sec-dispatcher:1.4=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.spockframework:spock-core:2.3-groovy-4.0=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.spockframework:spock-junit4:2.3-groovy-4.0=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath +org.redline-rpm:redline:1.2.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.36=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.sonatype.plexus:plexus-cipher:1.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.sonatype.plexus:plexus-sec-dispatcher:1.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.spockframework:spock-bom:2.4-groovy-4.0=testCompileClasspath,testRuntimeClasspath +org.spockframework:spock-core:2.4-groovy-4.0=testCompileClasspath,testRuntimeClasspath +org.spockframework:spock-junit4:2.4-groovy-4.0=testCompileClasspath,testRuntimeClasspath org.tukaani:xz:1.4=compileClasspath,integTestCompileClasspath,testCompileClasspath org.tukaani:xz:1.9=integTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath -org.vafer:jdeb:1.14=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -empty=annotationProcessor,integTestAnnotationProcessor,testAnnotationProcessor +org.vafer:jdeb:1.14=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +empty=annotationProcessor,testAnnotationProcessor diff --git a/gradle.properties b/gradle.properties index 10bf1d55..09754a70 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1,4 @@ systemProp.nebula.features.coreLockingSupport=true +org.gradle.caching=true +org.gradle.parallel=true +nebula.integTest=false \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 8a848873..4bdb2a9e 100755 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=72f44c9f8ebcb1af43838f45ee5c4aa9c5444898b3468ab3f4af7b6076c5bc3f -distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip +distributionSha256Sum=bafc141b619ad6350fd975fc903156dd5c151998cc8b058e8c1044ab5f7b031f +distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/settings.gradle b/settings.gradle index 6f7aa248..b7bb49da 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,13 +1,5 @@ plugins { - id 'com.gradle.develocity' version '3.19' - id("org.gradle.toolchains.foojay-resolver-convention") version("1.0.0") -} - -develocity { - buildScan { - termsOfUseUrl = "https://gradle.com/help/legal-terms-of-use" - termsOfUseAgree = 'yes' - } + id("com.netflix.nebula.oss.settings") version ("25.+") } rootProject.name='gradle-ospackage-plugin' diff --git a/src/main/groovy/com/netflix/gradle/plugins/application/OspackageApplicationDaemonPlugin.groovy b/src/main/groovy/com/netflix/gradle/plugins/application/OspackageApplicationDaemonPlugin.groovy index 4a05083d..c7642dfe 100644 --- a/src/main/groovy/com/netflix/gradle/plugins/application/OspackageApplicationDaemonPlugin.groovy +++ b/src/main/groovy/com/netflix/gradle/plugins/application/OspackageApplicationDaemonPlugin.groovy @@ -43,10 +43,10 @@ class OspackageApplicationDaemonPlugin implements Plugin { @Override void apply(Project project) { - project.plugins.apply(OspackageApplicationPlugin) + project.plugins.apply("com.netflix.nebula.ospackage-application") def ospackageApplicationExtension = project.extensions.getByType(OspackageApplicationExtension) - project.plugins.apply(OspackageDaemonPlugin) + project.plugins.apply("com.netflix.nebula.ospackage-daemon") // Mechanism for user to configure daemon further List daemonConfiguration = [] diff --git a/src/main/groovy/com/netflix/gradle/plugins/daemon/OspackageDaemonPlugin.groovy b/src/main/groovy/com/netflix/gradle/plugins/daemon/OspackageDaemonPlugin.groovy index 0a4fe7e0..c686f931 100644 --- a/src/main/groovy/com/netflix/gradle/plugins/daemon/OspackageDaemonPlugin.groovy +++ b/src/main/groovy/com/netflix/gradle/plugins/daemon/OspackageDaemonPlugin.groovy @@ -16,17 +16,18 @@ package com.netflix.gradle.plugins.daemon -import com.netflix.gradle.plugins.packaging.SystemPackagingBasePlugin import com.netflix.gradle.plugins.packaging.SystemPackagingTask import com.netflix.gradle.plugins.rpm.Rpm import com.netflix.gradle.plugins.utils.FilePermissionUtil import com.netflix.gradle.plugins.utils.WrapUtil import groovy.text.GStringTemplateEngine import groovy.transform.CompileDynamic +import groovy.transform.CompileStatic import org.gradle.api.DomainObjectSet import org.gradle.api.Plugin import org.gradle.api.Project +@CompileStatic class OspackageDaemonPlugin implements Plugin { public static final String POST_INSTALL_TEMPLATE = "postInstall" DaemonExtension extension @@ -53,7 +54,7 @@ class OspackageDaemonPlugin implements Plugin { @Override void apply(Project project) { - project.plugins.apply(SystemPackagingBasePlugin) + project.plugins.apply("com.netflix.nebula.ospackage-base") DomainObjectSet daemonsList = WrapUtil.toDomainObjectSet(DaemonDefinition) extension = project.extensions.create('daemons', DaemonExtension, daemonsList) @@ -65,7 +66,7 @@ class OspackageDaemonPlugin implements Plugin { extension.daemon(closure) }) - extension.daemons.all { DaemonDefinition definition -> + extension.daemons.configureEach { DaemonDefinition definition -> // Check existing name def sameName = daemonsList.any { !it.is(definition) && it.daemonName == definition.daemonName } if (sameName) { diff --git a/src/main/groovy/com/netflix/gradle/plugins/deb/DebPlugin.groovy b/src/main/groovy/com/netflix/gradle/plugins/deb/DebPlugin.groovy index 674d3606..a6748ee8 100644 --- a/src/main/groovy/com/netflix/gradle/plugins/deb/DebPlugin.groovy +++ b/src/main/groovy/com/netflix/gradle/plugins/deb/DebPlugin.groovy @@ -21,7 +21,6 @@ import com.netflix.gradle.plugins.packaging.AliasHelper import com.netflix.gradle.plugins.packaging.CommonPackagingPlugin import com.netflix.gradle.plugins.rpm.RpmPlugin import groovy.transform.CompileDynamic -import org.gradle.api.Action import org.gradle.api.Plugin import org.gradle.api.Project diff --git a/src/main/groovy/com/netflix/gradle/plugins/docker/OsPackageDockerPlugin.groovy b/src/main/groovy/com/netflix/gradle/plugins/docker/OsPackageDockerPlugin.groovy index c2351ecc..d3d0fa40 100644 --- a/src/main/groovy/com/netflix/gradle/plugins/docker/OsPackageDockerPlugin.groovy +++ b/src/main/groovy/com/netflix/gradle/plugins/docker/OsPackageDockerPlugin.groovy @@ -1,17 +1,13 @@ package com.netflix.gradle.plugins.docker -import com.bmuschko.gradle.docker.DockerRemoteApiPlugin -import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage -import com.netflix.gradle.plugins.packaging.CommonPackagingPlugin -import com.netflix.gradle.plugins.packaging.SystemPackagingBasePlugin import org.gradle.api.Plugin import org.gradle.api.Project class OsPackageDockerPlugin implements Plugin { @Override void apply(Project project) { - project.plugins.apply(SystemPackagingBasePlugin) - project.plugins.apply(OsPackageDockerBasePlugin) - project.plugins.apply(DockerRemoteApiPlugin) + project.plugins.apply("com.netflix.nebula.ospackage-base") + project.plugins.apply("com.netflix.nebula.ospackage-docker-base") + project.plugins.apply("com.bmuschko.docker-remote-api") } } diff --git a/src/main/groovy/com/netflix/gradle/plugins/packaging/CommonPackagingPlugin.groovy b/src/main/groovy/com/netflix/gradle/plugins/packaging/CommonPackagingPlugin.groovy index 7c6bb83c..c36a84d4 100644 --- a/src/main/groovy/com/netflix/gradle/plugins/packaging/CommonPackagingPlugin.groovy +++ b/src/main/groovy/com/netflix/gradle/plugins/packaging/CommonPackagingPlugin.groovy @@ -22,7 +22,7 @@ import org.gradle.api.plugins.BasePlugin class CommonPackagingPlugin implements Plugin { void apply(Project project) { - project.plugins.apply(BasePlugin.class) + project.plugins.apply("base") // Used to be used to add metaClass properties to CopySpec, but now it's done with CopySpecEnhancement } diff --git a/src/main/groovy/com/netflix/gradle/plugins/packaging/SystemPackagingBasePlugin.groovy b/src/main/groovy/com/netflix/gradle/plugins/packaging/SystemPackagingBasePlugin.groovy index 589c5f00..ebe00d44 100644 --- a/src/main/groovy/com/netflix/gradle/plugins/packaging/SystemPackagingBasePlugin.groovy +++ b/src/main/groovy/com/netflix/gradle/plugins/packaging/SystemPackagingBasePlugin.groovy @@ -17,37 +17,27 @@ package com.netflix.gradle.plugins.packaging import com.netflix.gradle.plugins.deb.DebPlugin -import com.netflix.gradle.plugins.docker.OsPackageDockerBasePlugin -import com.netflix.gradle.plugins.docker.OsPackageDockerPlugin import com.netflix.gradle.plugins.rpm.RpmPlugin import org.gradle.api.Plugin import org.gradle.api.Project -import org.gradle.api.logging.Logger -import org.gradle.api.logging.Logging class SystemPackagingBasePlugin implements Plugin { - private static Logger logger = Logging.getLogger(SystemPackagingBasePlugin); - - Project project ProjectPackagingExtension extension public static final String taskBaseName = 'ospackage' void apply(Project project) { - - this.project = project - // Extension is created before plugins are, so tasks - extension = createExtension() + extension = createExtension(project) RpmPlugin.applyAliases(extension) // RPM Specific aliases DebPlugin.applyAliases(extension) // DEB-specific aliases - project.plugins.apply(RpmPlugin.class) - project.plugins.apply(DebPlugin.class) - project.plugins.apply(OsPackageDockerBasePlugin) + project.plugins.apply("com.netflix.nebula.rpm") + project.plugins.apply("com.netflix.nebula.deb") + project.plugins.apply("com.netflix.nebula.ospackage-docker-base") } - ProjectPackagingExtension createExtension() { + ProjectPackagingExtension createExtension(Project project) { ProjectPackagingExtension extension = project.extensions.create(taskBaseName, ProjectPackagingExtension, project) return extension } diff --git a/src/main/groovy/com/netflix/gradle/plugins/packaging/SystemPackagingPlugin.groovy b/src/main/groovy/com/netflix/gradle/plugins/packaging/SystemPackagingPlugin.groovy index bf07701c..59394b3e 100644 --- a/src/main/groovy/com/netflix/gradle/plugins/packaging/SystemPackagingPlugin.groovy +++ b/src/main/groovy/com/netflix/gradle/plugins/packaging/SystemPackagingPlugin.groovy @@ -25,12 +25,9 @@ import org.gradle.api.Project * Create implicit tasks, which will inherit from the ospackage extension. */ class SystemPackagingPlugin implements Plugin { - Project project - void apply(Project project) { - - this.project = project - project.plugins.apply(SystemPackagingBasePlugin.class) + void apply(Project project) { + project.plugins.apply("com.netflix.nebula.ospackage-base") project.tasks.register('buildDeb', Deb) project.tasks.register('buildRpm', Rpm) }