Skip to content

Commit 97ea932

Browse files
author
Wesley Hartford
committed
Chave Java version check to only apply when publishing
1 parent 1cb8eea commit 97ea932

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

build.gradle

+11-1
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,14 @@ if (this.hasProperty('jfrogUser') && this.hasProperty('jfrogPassword')) artifact
7878
}
7979
}
8080

81-
tasks.withType(PublishToMavenRepository) {it.dependsOn check}
81+
task javaVersionCheck() << {
82+
if (JavaVersion.current() != JavaVersion.VERSION_1_6) {
83+
throw new GradleException('Build must be run on Java 6')
84+
}
85+
}
86+
87+
tasks.withType(PublishToMavenRepository) {
88+
it.dependsOn check
89+
it.dependsOn javaVersionCheck
90+
}
91+

settings.gradle

-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
if (JavaVersion.current() != JavaVersion.VERSION_1_6) {
2-
throw new GradleException('This build must be run with Java 6')
3-
}
4-
51
rootProject.name = 'gradle-dependency-analyze'

0 commit comments

Comments
 (0)