This repository has been archived by the owner on May 4, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
139 lines (124 loc) · 4.22 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
129
130
131
132
133
134
135
136
137
138
139
buildscript {
configurations.classpath {
resolutionStrategy.activateDependencyLocking()
}
repositories {
maven {
url 'https://sonatype.netifiinc.com/repository/netifi-plugin-group/'
credentials {
username = "${netifiReadOnlyUsername}"
password = "${netifiReadOnlyPassword}"
}
}
}
dependencies {
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4"
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.8.1"
classpath 'com.google.gradle:osdetector-gradle-plugin:1.6.2'
}
}
plugins {
id 'com.gradle.build-scan' version '2.0.2' // declare before any other plugin
id 'io.spring.dependency-management' version '1.0.7.RELEASE' apply false
id "com.github.hierynomus.license" version '0.15.0'
id 'com.palantir.git-version' version '0.12.0-rc2'
}
buildScan {
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
}
def details = versionDetails()
def versionSuffix = ""
def buildNumber = "${System.getenv("BUILD_NUMBER") ?: "dev"}"
def tmpArtifactVersion = "${project.version}"
if (details.branchName != null) {
if (details.branchName.startsWith("develop")) {
versionSuffix = "-SNAPSHOT"
tmpArtifactVersion += "-${buildNumber}-SNAPSHOT"
} else if (details.branchName.startsWith("release")) {
versionSuffix = "-RC"
tmpArtifactVersion += "-${buildNumber}-RC"
} else if (details.branchName.split("/").size() > 1) {
versionSuffix = "-${details.branchName.replace("/","-")}-SNAPSHOT"
tmpArtifactVersion += "-${details.branchName.replace("/","-")}-${buildNumber}-SNAPSHOT"
}
}
allprojects {
dependencyLocking {
lockAllConfigurations()
}
repositories {
maven {
url 'https://sonatype.netifiinc.com/repository/jcenter/'
credentials {
username = "${netifiReadOnlyUsername}"
password = "${netifiReadOnlyPassword}"
}
}
maven {
url 'https://sonatype.netifiinc.com/repository/maven-central/'
credentials {
username = "${netifiReadOnlyUsername}"
password = "${netifiReadOnlyPassword}"
}
}
maven {
url 'https://sonatype.netifiinc.com/repository/netifi-oss/'
credentials {
username = "${netifiReadOnlyUsername}"
password = "${netifiReadOnlyPassword}"
}
}
maven {
url 'https://sonatype.netifiinc.com/repository/netifi-artifactory-libs-release-local/'
credentials {
username = "${netifiReadOnlyUsername}"
password = "${netifiReadOnlyPassword}"
}
}
maven {
url 'https://sonatype.netifiinc.com/repository/netifi-artifactory-libs-snapshot-local/'
credentials {
username = "${netifiReadOnlyUsername}"
password = "${netifiReadOnlyPassword}"
}
}
}
}
subprojects {
apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'com.google.osdetector'
apply from: '../dependency-management.gradle'
// apply plugin: 'license'
project.version += project.hasProperty('versionSuffix') ? project.property('versionSuffix') : ''
sourceCompatibility = 1.8
targetCompatibility = 1.8
compileTestJava {
sourceCompatibility = 11
targetCompatibility = 11
}
ext {
artifactVersion = "${tmpArtifactVersion}"
}
// Build Source Jarst
def sourcesJarMap = [name: 'sourcesJar', type: Jar, dependsOn: classes]
project.tasks.create(sourcesJarMap, {
classifier = 'sources'
from sourceSets.main.allSource
version = "${project.version}"
})
// Build Javadoc Jars
def javadocJarMap = [name: 'javadocJar', type: Jar, dependsOn: javadoc]
project.tasks.create(javadocJarMap, {
classifier = 'javadoc'
from javadoc.destinationDir
version = "${project.version}"
})
artifacts {
archives sourcesJar
archives javadocJar
}
}