forked from musketyr/gradle-fatjar-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
124 lines (110 loc) · 4.21 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:3.0.1"
}
}
apply plugin: 'groovy'
apply plugin: 'maven-publish'
apply plugin: "com.jfrog.artifactory"
group = 'eu.appsatori'
version = '0.4-SNAPSHOT'
repositories {
jcenter()
}
dependencies {
compile localGroovy()
compile gradleApi()
testCompile ("org.spockframework:spock-core:0.7-groovy-2.0") {
exclude module : 'groovy-all' //localGroovy and spock groovy will probably conflict. Both are 2.x, we're good.
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from destinationDir
}
ext.bintrayUsername = project.hasProperty('bintrayUser')?project.bintrayUser:System.getenv('BINTRAY_USER')?:''
ext.bintrayKey = project.hasProperty('bintrayKey')?project.bintrayKey:System.getenv('BINTRAY_KEY')?:''
artifactory {
contextUrl = 'https://oss.jfrog.org'
resolve {
repository {
repoKey = 'libs-release'
}
}
publish {
repository {
repoKey = 'oss-snapshot-local' //The Artifactory repository key to publish to
//when using oss.jfrog.org the credentials are from Bintray. For local build we expect them to be found in
//~/.gradle/gradle.properties, otherwise to be set in the build server
username = bintrayUsername
password = bintrayKey
}
defaults {
publications 'main'
}
}
}
publishing {
publications {
main(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom.withXml {
asNode().with {
appendNode('packaging', 'jar')
appendNode('name', 'Gradle FatJar Plugin')
appendNode('description', 'Gradle plugin to build fat JARs with dependencies.')
appendNode('url', 'https://github.com/musketyr/gradle-fatjar-plugin.git')
appendNode('licenses').with {
appendNode('license').with {
appendNode('name', 'The Apache Software License, Version 2.0')
appendNode('url', 'http://www.apache.org/licenses/LICENSE-2.0')
}
}
appendNode('developers').with {
appendNode('developer').with {
appendNode('id', 'vladimirorany')
appendNode('name', 'Vladimir Orany')
}
appendNode('developer').with {
appendNode('id', 'ben-manes')
appendNode('name', 'Ben Manes')
}
appendNode('developer').with {
appendNode('id', 'nhan')
appendNode('name', 'Nhan Nguyen')
}
appendNode('developer').with {
appendNode('id', 'jbaruch')
appendNode('name', 'Baruch Sadogursky')
appendNode('email', '[email protected]')
}
}
appendNode('scm').with {
appendNode('connection', 'scm:git://github.com/glaforge/gradle-fatjar-plugin.git')
appendNode('developerConnection', 'scm:git://github.com/glaforge/gradle-fatjar-plugin.git')
appendNode('url', 'scm:git://github.com/musketyr/gradle-fatjar-plugin.git')
}
}
asNode().dependencies.'*'.findAll() {
it.scope.text() == 'runtime' && project.configurations.compile.allDependencies.find { dep ->
dep.name == it.artifactId.text()
}
}.each() {
it.scope*.value = 'compile'
}
}
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.0'
}