-
Notifications
You must be signed in to change notification settings - Fork 174
/
build.gradle
118 lines (100 loc) · 3.09 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
buildscript {
project.ext {
if(has('privateRepoDir')) {
privateRepoDir = privateRepoDir instanceof File ? privateRepoDir.path : privateRepoDir.toString()
if(!new File(privateRepoDir).isAbsolute())
privateRepoDir = new File(projectDir, privateRepoDir).canonicalPath
} else
privateRepoDir = new File(project.buildDir, 'privateRepo').canonicalPath
}
repositories {
maven {
url "file:$privateRepoDir"
}
jcenter()
maven {
url 'http://dl.bintray.com/content/noamt/gradle-plugins'
}
}
dependencies {
classpath 'org.apache.commons:commons-lang3:3.4'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:3.1.0'
classpath 'org._10ne.gradle:rest-gradle-plugin:0.3.2'
classpath 'org.codehaus.groovy.modules.http-builder:http-builder:0.7.1'
}
}
import org._10ne.gradle.rest.RestPlugin
import org._10ne.gradle.rest.RestTask
import groovyx.net.http.ContentType
plugins {
id 'base'
id 'maven-publish'
}
apply plugin: 'com.jfrog.artifactory'
apply plugin: RestPlugin
ext {
project_website = "https://github.com/${developerId}/${projectId}"
project_scm = "scm:[email protected]:${developerId}/${projectId}.git"
license_url = "https://raw.github.com/${developerId}/${projectId}/master/LICENSE"
if( !has( 'bintrayUser' ) )
bintrayUser = ''
if( !has( 'bintrayKey' ) )
bintrayKey = ''
if( !has( 'bintrayKeyPhrase' ) )
bintrayKeyPhrase = ''
if( !has( 'bintrayDryRun' ) )
bintrayDryRun = false
if( !has('artifactory_contextUrl'))
artifactory_contextUrl = 'https://oss.jfrog.org/artifactory'
}
if(!bintrayDryRun)
task bintraySign(type: RestTask) {
description 'Push to bintray and sign it.'
httpMethod = 'post'
uri = "https://api.bintray.com/gpg/${project.developerId}/maven/${project.projectId}/versions/${project.version}"
username = project.bintrayUser
password = project.bintrayKey
requestBody = [ passphrase: project.bintrayKeyPhrase ]
contentType = ContentType.JSON
}
task('buildIntegrationTests', type: GradleBuild) {
dir = file('integrationTests')
tasks = [ 'build' ]
project.tasks.build.finalizedBy it
onlyIf { !project.tasks.build.getState().getFailure() }
}
task('testAll', dependsOn: tasks.build)
task('testAllIntegrationTests', type: GradleBuild) {
dependsOn buildIntegrationTests
dir = file('integrationTests')
tasks = [ 'testAll' ]
project.tasks.testAll.finalizedBy it
onlyIf { !project.tasks.testAll.getState().getFailure() }
}
task('cleanIntegrationTests', type: GradleBuild) {
dir = file('integrationTests')
tasks = [ 'clean' ]
project.tasks.clean.dependsOn it
}
task('wrapper', type: Wrapper) {
gradleVersion = '2.14.1'
}
artifactory {
contextUrl = artifactory_contextUrl
publish {
repository {
if (project.version.endsWith('-SNAPSHOT'))
repoKey = 'oss-snapshot-local'
else
repoKey = 'oss-release-local'
username = project.bintrayUser
password = project.bintrayKey
}
}
resolve {
repository {
repoKey = 'repo'
}
}
}