-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.gradle
128 lines (109 loc) · 3.87 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
125
126
127
128
plugins {
id 'maven-publish'
id 'com.jfrog.bintray' version '1.6'
id 'net.researchgate.release' version '2.3.4'
}
apply plugin: 'groovy'
apply plugin: 'distribution'
apply plugin: 'maven'
configurations {
provided
compile.extendsFrom provided
}
task testme << {
println "here: ${configurations}"
}
repositories {
maven { url 'https://build.shibboleth.net/nexus/content/groups/public'}
maven { url 'http://dl.bintray.com/uniconiam/maven' }
jcenter()
}
dependencies {
compile "org.codehaus.groovy:groovy-all:${project.'groovy.version'}"
compile "net.unicon.iam:duo-java:${project.'duo-java.version'}"
compile "com.duosecurity:duo-client:0.2.1"
provided "org.springframework:spring-context:${project.'spring.version'}"
provided "org.springframework.webflow:spring-webflow:${project.'spring-webflow.version'}"
provided "org.slf4j:slf4j-api:${project.'slf4j.version'}"
provided "net.shibboleth.idp:idp-authn-api:${project.'shibboleth.version'}"
provided "net.shibboleth.idp:idp-authn-impl:${project.'shibboleth.version'}"
provided "net.shibboleth.idp:idp-session-api:${project.'shibboleth.version'}"
provided "javax.servlet:javax.servlet-api:3.0.1"
provided "com.google.guava:guava:${project.'guava.version'}"
}
distributions {
main {
contents {
duplicatesStrategy = 'exclude'
into ('edit-webapp/WEB-INF/lib') {
from { project.jar }
from { (project.configurations.compile - project.configurations.provided) }
}
}
}
}
task sourceJar(type: Jar) {
from sourceSets.main.allGroovy
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourceJar {
classifier 'sources'
}
pom.withXml {
asNode().dependencies.'*'.findAll() {
it.scope.text() == 'runtime' && project.configurations.compile.allDependencies.find { dep -> dep.name == it.artifactId.text() } && !project.configurations.provided.allDependencies.find { dep -> dep.name == it.artifactId.text() }
}.each {
it.scope*.value = 'compile'
}
asNode().dependencies.'*'.findAll() {
it.scope.text() == 'runtime' && project.configurations.provided.allDependencies.find { dep -> dep.name == it.artifactId.text() }
}.each {
it.scope*.value = 'provided'
}
}
}
}
}
task uploadDist(type: com.jfrog.bintray.gradle.BintrayUploadTask) {
apiUrl = 'https://api.bintray.com'
user = bintrayUsername
apiKey = bintrayAPIKey
userOrg = 'uniconiam'
packageName = rootProject.name
repoName = 'generic'
versionName = project.version
packageLicenses = ['Apache-2.0']
packageVcsUrl = 'https://github.com/Unicon/shib-mfa-duo-auth.git'
dependsOn project.task(type: com.jfrog.bintray.gradle.RecordingCopyTask, com.jfrog.bintray.gradle.RecordingCopyTask.NAME).with {
ConfigureUtil.configure({
from distZip
from distTar
into '.'
}, it)
it.outputs.upToDateWhen {false}
return it
}
}
task uploadMaven(type: com.jfrog.bintray.gradle.BintrayUploadTask) {
apiUrl = 'https://api.bintray.com'
user = bintrayUsername
apiKey = bintrayAPIKey
userOrg = 'uniconiam'
packageName = rootProject.name
repoName = 'maven'
versionName = project.version
packageLicenses = ['Apache-2.0']
packageVcsUrl = 'https://github.com/Unicon/shib-mfa-duo-auth.git'
publications = ['mavenJava']
dependsOn build
dependsOn 'generatePomFileForMavenJavaPublication'
dependsOn sourceJar
}
afterReleaseBuild.dependsOn uploadDist
afterReleaseBuild.dependsOn uploadMaven
task wrapper(type: Wrapper) {
gradleVersion = 2.4
}