-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.gradle
143 lines (128 loc) · 4.75 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
import com.jfrog.bintray.gradle.BintrayUploadTask
import proguard.gradle.ProGuardTask
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.4.0-alpha6'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
classpath 'net.sf.proguard:proguard-gradle:5.3.3'
}
}
allprojects {
repositories {
jcenter()
mavenLocal()
}
group 'alchemy'
version '1.0.0'
}
ext {
minSdkVersion = 15
targetSdkVersion = 25
compileSdkVersion = 25
buildToolsVersion = '25.0.2'
}
ext.deps = [
junit : 'junit:junit:4.12',
mockito : 'org.mockito:mockito-core:2.7.22',
hamcrest: 'org.hamcrest:java-hamcrest:2.0.0.0'
]
configure([project(':alchemy'), project(':alchemy-annotations'),
project(':alchemy-sqlite'), project(':alchemy-sqlite-compiler')]) {
task proguard(type: ProGuardTask, dependsOn: 'jar') {
configuration 'proguard.pro'
injars "${project.buildDir}/libs/${project.name}-${project.version}.jar"
outjars "${project.buildDir}/libs/${project.name}-release-${project.version}.jar"
libraryjars "${System.getProperty('java.home')}/lib/rt.jar"
printmapping "${project.buildDir}/tmp/mapping.txt"
printusage "${project.buildDir}/tmp/usage.txt"
dump "${project.buildDir}/tmp/dump.txt"
}
project.tasks.withType(PublishToMavenLocal).all { it.dependsOn proguard }
}
configure([project(':alchemy'), project(':alchemy-annotations'),
project(':alchemy-sqlite'), project(':alchemy-sqlite-compiler')]) {
apply plugin: 'java'
apply plugin: 'maven-publish'
task sourcesJar(type: Jar, dependsOn: classes) {
from sourceSets.main.allSource
}
publishing {
publications {
maven(MavenPublication) {
groupId rootProject.group
artifactId project.name
version rootProject.version
artifact project.file("${project.buildDir}/libs/${project.name}-release-${project.version}.jar")
artifact sourcesJar {
classifier "sources"
}
pom.withXml {
asNode().children().last() + project.pomXml
def dependencies = asNode().appendNode('dependencies')
configurations.compile.allDependencies.each {
def dependency = dependencies.appendNode('dependency')
dependency.appendNode('groupId', it.group)
dependency.appendNode('artifactId', it.name)
dependency.appendNode('version', it.version)
dependency.appendNode('scope', 'compile')
}
}
}
}
}
}
configure([project(':alchemy'), project(':alchemy-annotations'),
project(':alchemy-sqlite'), project(':alchemy-sqlite-compiler'),
project(':alchemy-android'), project(':alchemy-sqlite4a'),
project(':alchemy-sqlcipher')]) {
ext {
pomXml = {
name project.name
resolveStrategy = DELEGATE_FIRST
url 'https://github.com/DanielSerdyukov/alchemy'
scm {
url 'https://github.com/DanielSerdyukov/alchemy.git'
connection 'scm:git:git://github.com/DanielSerdyukov/alchemy.git'
developerConnection 'scm:git:[email protected]/DanielSerdyukov/alchemy.git'
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/license/LICENSE-2.0.txt'
distribution 'repo'
}
}
developers {
developer {
name 'Daniel Serdyukov'
}
}
}
}
}
configure([project(':alchemy'), project(':alchemy-annotations'),
project(':alchemy-sqlite'), project(':alchemy-sqlite-compiler'),
project(':alchemy-android'), project(':alchemy-sqlite4a'),
project(':alchemy-sqlcipher')]) {
apply plugin: 'com.jfrog.bintray'
bintray {
user = rootProject.properties.get('bintray.user')
key = rootProject.properties.get('bintray.apikey')
publications = ['maven']
override = true
pkg {
repo = 'alchemy'
name = 'alchemy'
licenses = ['Apache-2.0']
vcsUrl = 'https://github.com/DanielSerdyukov/alchemy.git'
version {
name = rootProject.version
released = new Date()
}
}
}
project.tasks.withType(BintrayUploadTask).all { it.dependsOn 'publishToMavenLocal' }
}