-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle
97 lines (85 loc) · 1.84 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:2.2.3'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6'
}
}
apply plugin: 'groovy'
apply plugin: 'java-gradle-plugin'
apply plugin: 'idea'
apply plugin: 'artifactory'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'artifactory'
apply plugin: 'com.jfrog.bintray'
repositories {
jcenter()
}
group = "com.github.danveloper"
version = "1.0.2"
dependencies {
compile gradleApi()
testCompile gradleTestKit()
testCompile("org.spockframework:spock-core:1.0-groovy-2.4") {
exclude module: 'groovy-all'
}
}
artifactory {
contextUrl = 'http://oss.jfrog.org'
}
ext.isSnapshot = version.endsWith('-SNAPSHOT')
artifactoryPublish { task ->
rootProject.artifactory {
publish {
repository {
repoKey = isSnapshot ? 'oss-snapshot-local' : 'oss-release-local'
gradle.taskGraph.whenReady { taskGraph ->
if (taskGraph.hasTask(task)) {
username = bintrayUser
password = bintrayKey
}
}
}
}
}
}
task sourceJar(type: Jar) {
classifier "sources"
from sourceSets.main.allJava
}
publishing {
publications {
maven(MavenPublication) {
from components.java
artifact sourceJar
}
}
}
bintrayUpload { task ->
doFirst {
if (isSnapshot) {
throw new GradleException('Cannot publish SNAPSHOT versions to BinTray!')
}
}
gradle.taskGraph.whenReady { taskGraph ->
if (taskGraph.hasTask(task)) {
task.user = bintrayUser
task.apiKey = bintrayKey
}
}
}
bintray {
publications = ['maven']
publish = true
dryRun = false
pkg {
name = "gradle-js"
userOrg = "danveloper"
repo = 'maven'
licenses = ['WTFPL']
labels = ['gradle', 'javascript']
}
}