From e44caa02288e944a169abc305fcd0bf69692af7d Mon Sep 17 00:00:00 2001 From: Yahav Itzhak Date: Mon, 28 Aug 2023 17:09:32 +0300 Subject: [PATCH] Use Gradle extractor 5 on Gradle >= 6.8.1 (#901) --- artifactory/utils/gradleinitscript.go | 41 --------------------------- go.mod | 2 +- go.sum | 4 +-- utils/gradle/utils.go | 3 +- 4 files changed, 4 insertions(+), 46 deletions(-) delete mode 100644 artifactory/utils/gradleinitscript.go diff --git a/artifactory/utils/gradleinitscript.go b/artifactory/utils/gradleinitscript.go deleted file mode 100644 index 2862e38c5..000000000 --- a/artifactory/utils/gradleinitscript.go +++ /dev/null @@ -1,41 +0,0 @@ -package utils - -const GradleInitScript = `import org.jfrog.gradle.plugin.artifactory.ArtifactoryPlugin -import org.jfrog.gradle.plugin.artifactory.task.ArtifactoryTask - -initscript { - dependencies { - classpath fileTree('${pluginLibDir}') - } -} - -addListener(new BuildInfoPluginListener()) -class BuildInfoPluginListener extends BuildAdapter { - - def void projectsLoaded(Gradle gradle) { - Map projectProperties = new HashMap(gradle.startParameter.getProjectProperties()) - projectProperties.put("build.start", Long.toString(System.currentTimeMillis())) - gradle.startParameter.setProjectProperties(projectProperties) - - Project root = gradle.getRootProject() - root.logger.debug("Artifactory plugin: projectsEvaluated: ${root.name}") - if (!"buildSrc".equals(root.name)) { - root.allprojects { - apply { - apply plugin: ArtifactoryPlugin - } - } - } - - // Set the "mavenJava" and "ivyJava" publications or - // "archives" configuration to all Artifactory tasks. - for (Project p : root.getAllprojects()) { - Task t = p.getTasks().findByName(ArtifactoryTask.ARTIFACTORY_PUBLISH_TASK_NAME) - if (t != null) { - ArtifactoryTask task = (ArtifactoryTask) t - task.setCiServerBuild() - } - } - } -} -` diff --git a/go.mod b/go.mod index dc575a9ae..d3ed9cc42 100644 --- a/go.mod +++ b/go.mod @@ -95,6 +95,6 @@ require ( // replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go v1.28.1-0.20230803140217-0a5f43783ae8 -// replace github.com/jfrog/build-info-go => github.com/jfrog/build-info-go v1.8.9-0.20230820165857-52ff32c4d8eb +replace github.com/jfrog/build-info-go => github.com/jfrog/build-info-go v1.8.9-0.20230828134416-f0db33dd9344 // replace github.com/jfrog/gofrog => github.com/jfrog/gofrog v1.2.6-0.20230418122323-2bf299dd6d27 diff --git a/go.sum b/go.sum index 937fd2ed8..f81ff1c93 100644 --- a/go.sum +++ b/go.sum @@ -196,8 +196,8 @@ github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOl github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jedib0t/go-pretty/v6 v6.4.6 h1:v6aG9h6Uby3IusSSEjHaZNXpHFhzqMmjXcPq1Rjl9Jw= github.com/jedib0t/go-pretty/v6 v6.4.6/go.mod h1:Ndk3ase2CkQbXLLNf5QDHoYb6J9WtVfmHZu9n8rk2xs= -github.com/jfrog/build-info-go v1.9.8 h1:D8/ga+YgQpqp/CJj2zteS4/twmSy8zvm1v9lCd2Kv1M= -github.com/jfrog/build-info-go v1.9.8/go.mod h1:t31QRpH5xUJKw8XkQlAA+Aq7aanyS1rrzpcK8xSNVts= +github.com/jfrog/build-info-go v1.8.9-0.20230828134416-f0db33dd9344 h1:zU+F+61OSnafhH3lq9b3dEKgrM5KodrCRXXRc2/wcZ0= +github.com/jfrog/build-info-go v1.8.9-0.20230828134416-f0db33dd9344/go.mod h1:t31QRpH5xUJKw8XkQlAA+Aq7aanyS1rrzpcK8xSNVts= github.com/jfrog/gofrog v1.3.0 h1:o4zgsBZE4QyDbz2M7D4K6fXPTBJht+8lE87mS9bw7Gk= github.com/jfrog/gofrog v1.3.0/go.mod h1:IFMc+V/yf7rA5WZ74CSbXe+Lgf0iApEQLxRZVzKRUR0= github.com/jfrog/jfrog-client-go v1.31.6 h1:uWuyT4BDm9s5ES6oDTBny9Gl6yf8iKFjcbmHSHQZrDc= diff --git a/utils/gradle/utils.go b/utils/gradle/utils.go index 093e941c7..0aa27d8c6 100644 --- a/utils/gradle/utils.go +++ b/utils/gradle/utils.go @@ -5,7 +5,6 @@ import ( "path/filepath" "strings" - "github.com/jfrog/build-info-go/build" "github.com/jfrog/jfrog-cli-core/v2/artifactory/utils" "github.com/jfrog/jfrog-cli-core/v2/utils/config" "github.com/jfrog/jfrog-cli-core/v2/utils/coreutils" @@ -53,7 +52,7 @@ func getGradleDependencyLocalPath() (string, error) { if err != nil { return "", err } - return filepath.Join(dependenciesPath, "gradle", build.GradleExtractorDependencyVersion), nil + return filepath.Join(dependenciesPath, "gradle"), nil } func createGradleRunConfig(vConfig *viper.Viper, deployableArtifactsFile string, threads int, disableDeploy bool) (props map[string]string, wrapper, plugin bool, err error) {