File tree 1 file changed +15
-1
lines changed
src/main/groovy/com/jfrog/bintray/gradle
1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -35,9 +35,11 @@ class BintrayUploadTask extends DefaultTask {
35
35
String apiUrl
36
36
37
37
@Input
38
+ @Optional
38
39
String user
39
40
40
41
@Input
42
+ @Optional
41
43
String apiKey
42
44
43
45
@Input
@@ -66,9 +68,11 @@ class BintrayUploadTask extends DefaultTask {
66
68
String userOrg
67
69
68
70
@Input
71
+ @Optional
69
72
String repoName
70
73
71
74
@Input
75
+ @Optional
72
76
String packageName
73
77
74
78
@Input
@@ -169,6 +173,10 @@ class BintrayUploadTask extends DefaultTask {
169
173
@TaskAction
170
174
void bintrayUpload () {
171
175
logger. info(" Gradle Bintray Plugin version: $pluginVersion " );
176
+ if (shouldSkip()) {
177
+ logger. info(" Skipping task {}" , this . project. name);
178
+ return
179
+ }
172
180
173
181
// TODO: [by yl] replace with findResults for Gradle 2.x
174
182
configurationUploads = configurations. collect {
@@ -465,6 +473,10 @@ class BintrayUploadTask extends DefaultTask {
465
473
}
466
474
}
467
475
476
+ boolean shouldSkip () {
477
+ return (user == null || apiKey == null )
478
+ }
479
+
468
480
String getPluginVersion () {
469
481
if (! releaseProps) {
470
482
Properties tempProps = new Properties ()
@@ -550,7 +562,9 @@ class BintrayUploadTask extends DefaultTask {
550
562
List<BintrayUploadTask > tasks = new ArrayList<BintrayUploadTask > ()
551
563
for (Task task : getProject(). getGradle(). getTaskGraph(). getAllTasks()) {
552
564
if (task instanceof BintrayUploadTask ) {
553
- tasks. add(task);
565
+ if (! task. shouldSkip()) {
566
+ tasks. add(task);
567
+ }
554
568
}
555
569
}
556
570
bintrayUploadTasks = tasks
You can’t perform that action at this time.
0 commit comments