-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
113 lines (98 loc) · 3.16 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
apply plugin: 'jacoco'
apply plugin: 'kotlin'
apply plugin: 'java'
apply plugin: 'org.sonarqube'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'maven-publish'
group 'xyo.network'
buildscript {
ext.kotlin_version = '1.3.31'
repositories {
mavenCentral()
mavenLocal()
jcenter()
google()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.31"
classpath "com.android.tools.build:gradle:3.2.1"
classpath "org.junit.platform:junit-platform-gradle-plugin:1.0.0-M4"
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.7"
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
}
}
def majorVersion = 1
def minorVersion = 0
Properties versionProps = new Properties()
def versionPropsFile = file('version.properties')
if (versionPropsFile.exists())
versionProps.load(new FileInputStream(versionPropsFile))
def code = (versionProps['VERSION_CODE'] ?: "0").toInteger() + 1
def verString = majorVersion + '.' + minorVersion + '.' + code
versionProps['VERSION_CODE'] = code.toString()
versionProps.store(versionPropsFile.newWriter(), null)
jacocoTestReport {
reports {
xml.enabled=true
html.enabled=false
}
}
sourceSets {
main {
java {
srcDirs += 'src/main/kotlin'
}
}
}
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.31"
implementation "org.json:json:20160212"
testImplementation "junit:junit:4.11"
}
publishing {
publications {
Production(MavenPublication) {
artifact("$buildDir/libs/sdk-objectmodel-kotlin.jar")
groupId 'network.xyo'
artifactId 'sdk-objectmodel-kotlin'
version verString
//The publication doesn't know about our dependencies, so we have to manually add them to the pom
pom.withXml {
//def dependenciesNode = asNode().appendNode('dependencies')
//Iterate over the compile dependencies (we don't want the test ones), adding a <dependency> node for each
configurations.compile.allDependencies.each {
if (it.name != 'unspecified') {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
}
}
}
}
bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_KEY')
dryRun = false
override = false
publish = true
pkg {
repo = 'xyo'
name = 'sdk-objectmodel-kotlin'
userOrg = 'xyoraclenetwork'
licenses = ['LGPL-3.0']
desc = 'Kotlin Object Model Classes'
vcsUrl = 'https://github.com/xyoraclenetwork/sdk-objectmodel-kotlin.git'
version {
name = verString
vcsTag = verString
}
}
publications = ['Production']
}