forked from skrugly/mirakle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
66 lines (53 loc) · 1.65 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
group 'com.instamotor'
version '1.3.3'
buildscript {
ext.kotlin_version = '1.3.72'
repositories {
mavenCentral()
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'gradle.plugin.de.fuerstenau:BuildConfigPlugin:1.1.8'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
}
}
apply plugin: 'maven'
allprojects {
apply plugin: 'de.fuerstenau.buildconfig'
apply plugin: 'kotlin'
apply plugin: 'idea'
buildConfig {
appName = rootProject.name
version = rootProject.version
packageName = rootProject.group
clsName = 'BuildConfig'
buildConfigField 'String[]', 'TESTED_GRADLE_VERSIONS', '{"4.9", "5.6.4", "6.0"}'
}
repositories {
mavenCentral()
jcenter()
}
sourceSets {
main {
java {
srcDirs += "${buildDir.absolutePath}/gen/buildconfig/src/main"
}
}
}
}
def gitTag() {
def tag = 'git tag --list --points-at HEAD'.execute((List) null, rootProject.projectDir).text.trim()
if (tag.split(System.lineSeparator()).length > 1) {
throw new IllegalStateException("gitTag is accessed but commit has multiple tags: $tag")
}
return tag
}
def validateTagAndVersion() {
if (gitTag().isEmpty()) {
throw new IllegalStateException('Publishing is not allowed because current commit has no tag')
}
if (version != gitTag().substring(1)) {
throw new IllegalStateException('Publishing is not allowed git tag version != project version')
}
}