-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
176 lines (148 loc) · 5 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
168
169
170
171
172
173
174
175
176
// This file is part of the ATMOSPHERE mobile testing framework.
// Copyright (C) 2016 MusalaSoft
//
// ATMOSPHERE is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ATMOSPHERE is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with ATMOSPHERE. If not, see <http://www.gnu.org/licenses/>.
apply plugin: 'maven-publish'
apply plugin: 'eu.appsatori.fatjar'
apply plugin: 'com.jfrog.bintray'
sourceCompatibility = 1.6
targetCompatibility = 1.6
import org.apache.tools.ant.taskdefs.condition.Os
// bintray publishing parameters
version = '0.0.2'
def organizationName = 'musala'
def repoName = 'atmosphere'
def projectName = 'atmosphere-uiautomator-bridge'
def url = 'https://github.com/MusalaSoft/atmosphere-uiautomator-bridge.git'
def description = ''
jar {
manifest {
attributes 'Implementation-Title': 'Atmosphere UIAutomator Bridge',
'Implementation-Version': version
}
}
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'eu.appsatori:gradle-fatjar-plugin:0.3'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.1'
}
}
project.ext {
dexDir = new File("${buildDir}/dex")
dexedJar = "${buildDir}/dex/${project.name}-${version}.jar"
}
repositories {
mavenLocal()
jcenter()
mavenCentral()
}
def androidSdkHome = "${System.getenv('ANDROID_HOME')}"
dependencies {
compile ('com.musala.atmosphere:framework-api19:0.+') {
ext {
fatJarExclude = true
}
}
compile ('com.musala.atmosphere:uiautomator-api18:0.+') {
ext {
fatJarExclude = true
}
}
compile 'de.mindpipe.android:android-logging-log4j:1.0.3'
compile ('com.musala.atmosphere:atmosphere-agent-device-lib:0.+') {
exclude module: 'framework-api19'
}
compile 'com.musala.atmosphere:openbeans-jxpath:0.+'
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-all:1.9.5'
}
publishing {
publications {
atmosphereUIAutomatorBridge(MavenPublication) {
groupId 'com.musala.atmosphere'
artifactId "$projectName"
version version
artifact source: project.dexedJar, extension: 'jar'
if (System.getProperty('bintray.user') != null) {
artifact sourcesJar
artifact javadocJar
}
}
}
repositories {
mavenLocal()
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.13'
}
fatJar {
doLast {
tasks.dex.execute()
}
}
// Credits here: http://wiliamsouza.github.io/#/2013/10/30/android-uiautomator-gradle-build-system
task dex(dependsOn: fatJar, type:Exec) {
project.dexDir.mkdirs()
workingDir '.'
def dx = 'dx' + (Os.isFamily(Os.FAMILY_WINDOWS) ? '.bat' : '')
commandLine androidSdkHome + '/' + androidSdkBuildToolsDir + '/' + dx, '--dex', '--no-strict', '--output=' + project.dexedJar, jar.archivePath
}
publishToMavenLocal.dependsOn fatJar
tasks.withType(JavaCompile) {
options.bootClasspath = bootClasspath
}
tasks.withType(Test) {
scanForTestClasses = false
include "**/*Test.class"
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
/*
This is publishing task that uploads the artifacts to bintray.com.
see: https://github.com/bintray/gradle-bintray-plugin
see: https://reflectoring.io/guide-publishing-to-bintray-with-gradle/
Use the following command for automatic upload to bintray:
$ ./gradlew bintrayUpload -Dbintray.user=<BINTRAY_USERNAME> -Dbintray.key=<BINTRAY_API_KEY> -Dgpg.pass=<ATMOSPHERE_PASSPHRASE>
*/
bintray {
user = System.getProperty('bintray.user')
key = System.getProperty('bintray.key')
publications = ['atmosphereUIAutomatorBridge']
pkg {
repo = "$repoName" // existing repository in bintray to add the artifacts to
name = "$projectName" // package name, current project name
userOrg = "$organizationName" // the name of the organization, If not added will use 'BINTRAY_USER' by default
licenses = ['GPL-3.0']
vcsUrl = "$url" // your VCS URL
version {
name = project.version.toString()
desc = "$description"
released = new Date()
gpg {
sign = true // Determines whether to GPG sign the files. The default is false
passphrase = System.getProperty('gpg.pass') // Optional. The passphrase for GPG signing'
}
}
}
}