-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
167 lines (149 loc) · 5.28 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
buildscript {
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
classpath 'net.linguica.gradle:maven-settings-plugin:0.5'
}
}
plugins {
id "com.github.hierynomus.license" version "0.15.0"
id 'net.researchgate.release' version '2.6.0'
}
allprojects {
ext.currentYear = Calendar.getInstance().get(Calendar.YEAR)
ext.copyright = "Copyright (C) $inceptionYear - $currentYear $organization"
ext.projectName = 'UI Localizer'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'net.linguica.maven-settings'
group = 'com.devexperts.uilocalizer'
release {
failOnCommitNeeded = false
failOnPublishNeeded = false
failOnSnapshotDependencies = false
failOnUnversionedFiles = false
failOnUpdateNeeded = true
revertOnFail = true
preCommitText = ''
tagCommitMessage = '[Gradle Release Plugin] - creating tag: '
newVersionCommitMessage = '[Gradle Release Plugin] - new version commit: '
tagTemplate = '${version}'
versionPropertyFile = 'gradle.properties'
versionProperties = []
buildTasks = ['license', 'build', 'javadocJar', 'sourcesJar']
scmAdapters = [
net.researchgate.release.GitAdapter,
]
git {
//requireBranch = 'gradleReleasePreparations'
//pushToRemote = 'origin'
pushToBranchPrefix = ''
commitVersionFileOnly = false
signTag = false
}
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives javadocJar, sourcesJar
}
beforeReleaseBuild.dependsOn publishToMavenLocal
}
configure(subprojects){
apply plugin: 'license'
sourceCompatibility = 1.8
targetCompatibility = 1.8
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
license {
ext.name = projectName
ext.copyright = copyright
strictCheck true
header rootProject.file('src/license/mpl_2.0/header.txt')
mapping {
java = 'SLASHSTAR_STYLE'
}
excludes(["**/*.properties", "inspectionDescriptions/NonLocalizedString.html", "**/*.xml"])
}
jar {
manifest {
attributes 'Implementation-Title': projectName + ': ' + project.name,
'Implementation-Version': version,
'Copyright': copyright,
'Built-by': System.getProperty('user.name'),
'Build-JDK': System.getProperty('java.version'),
'Source-Compatibity': sourceCompatibility,
'Target-Compatibity': targetCompatibility
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar {
classifier "sources"
}
artifact javadocJar
pom.withXml {
// remove api from dependencies
Node pomNode = asNode()
pomNode.dependencies.'*'.findAll() {
it.artifactId.text() == 'uilocalizer-api'
}.each() {
it.parent().remove(it)
}
// append additional metadata
asNode().children().last() + {
resolveStrategy = Closure.DELEGATE_FIRST
inceptionYear inceptionYear
organization {
name organization
url 'http://www.devexperts.com/'
}
scm {
connection 'scm:git:https://github.com/Devexperts/uilocalizer.git'
developerConnection 'scm:git:[email protected]/Devexperts/uilocalizer.git'
tag 'HEAD'
url 'https://github.com/Devexperts/uilocalizer.git'
}
issueManagement {
url 'https://github.com/Devexperts/uilocalizer/issues'
}
licenses {
license {
name 'MPL 2.0'
url 'http://mozilla.org/MPL/2.0/'
distribution 'repo'
}
}
}
}
}
}
repositories {
maven {
if (version.endsWith('SNAPSHOT')) {
name 'evolution-snapshots'
url 'https://maven.in.devexperts.com/content/repositories/evolution-snapshot/'
} else {
name 'evolution'
url 'https://maven.in.devexperts.com/content/repositories/evolution/'
}
}
}
}
repositories {
mavenCentral()
maven { url "https://devexperts.jfrog.io/artifactory/maven" }
}
}