forked from GENERALBYTESCOM/bitrafael_public
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
115 lines (104 loc) · 3.13 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
buildscript {
ext.with {
hasGbArtifactory = (project.hasProperty('gbArtifactoryUrl')
&& project.hasProperty('gbArtifactoryUser')
&& project.hasProperty('gbArtifactoryPassword'))
hasGbUploadArtifactory = (project.hasProperty('gbArtifactoryUploadUrl')
&& project.hasProperty('gbArtifactoryUser')
&& project.hasProperty('gbArtifactoryPassword'))
setRepositoriesFor = { RepositoryHandler repositoryHandler ->
if (hasGbArtifactory) {
repositoryHandler.maven {
credentials {
username gbArtifactoryUser
password gbArtifactoryPassword
}
url gbArtifactoryUrl
}
}
repositoryHandler.jcenter()
repositoryHandler.maven { url 'https://jitpack.io' }
}
batmDependencySubstitutionConfig = file('dependencySubstitutions.txt')
batmDependencyChecksumsConfig = file('dependencyChecksums.txt')
}
setRepositoriesFor(repositories)
}
plugins {
id 'com.generalbytes.gradle.main'
id 'pl.allegro.tech.build.axion-release' version '1.9.3'
}
scmVersion {
tag {
prefix = ''
}
}
allprojects {
setRepositoriesFor(buildscript.repositories)
setRepositoriesFor(repositories)
group = projectGroup
version = scmVersion.version
tasks.withType(JavaCompile) {
project.sourceCompatibility = JavaVersion.VERSION_1_8
project.targetCompatibility = JavaVersion.VERSION_1_8
options.encoding = 'UTF-8'
options.incremental = true
}
// Jars with the same contents should have the same checksums
tasks.withType(AbstractArchiveTask).configureEach {
preserveFileTimestamps = false
reproducibleFileOrder = true
}
afterEvaluate {
if (pluginManager.hasPlugin('com.generalbytes.gradle.dependency.verification')) {
dependencyChecksums {
global = true
}
dependencyVerifications {
// setConfigurations([]) // effectively turns off all checksum verifications
// failOnChecksumError = false // turns off failure on checksum problem (only warnings are printed)
}
}
if (pluginManager.hasPlugin('com.generalbytes.gradle.dependency.strict')) {
strictDependencies {
// conflictFail false // turns off failure on version conflict
}
}
}
}
dependencyVerifications {
checksums batmDependencyChecksumsConfig
printUnusedAssertions false
}
/**
* Basic release versioning workflow:
*
* $ git tag
* project-0.1.0
*
* $ ./gradlew currentVersion
* 0.1.0
*
* $ git commit -m "Some commit."
*
* $ ./gradlew currentVersion
* 0.1.1-SNAPSHOT
*
* $ ./gradlew createRelease
*
* $ git tag
* project-0.1.0 project-0.1.1
*
* $ git push --tags
*
* $ ./gradlew currentVersion
* 0.1.1
*
* $ ./gradlew publish
* published project-0.1.1 release version
*
* $ ./gradlew markNextVersion -Prelease.version=1.0.0
*
* $ ./gradlew currentVersion
* 1.0.0-SNAPSHOT
*/