Skip to content

Commit 5c90c98

Browse files
authored
Merge pull request #212 from arturCwiklinsky/upgrade_gradle_project
Upgrade gradle dependencies and settings
2 parents d8bacbe + 855b299 commit 5c90c98

File tree

8 files changed

+79
-67
lines changed

8 files changed

+79
-67
lines changed

README.md

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
11
Gradle plugin to deploys apks to BitBar cloud and launches test run.
22

3+
## Developing and building gradle plugin locally
4+
5+
To build and publish gradle plugin locally run
6+
7+
```bash
8+
./gradlew clean build publishToMavenLocal -PenableAutoPublish
9+
```
10+
11+
## Running gradle plugin
12+
313
A typical project build.gradle will look like this:
414

515
plugins {
616
id 'com.android.application'
7-
id 'testdroid' version '3.26' apply true
17+
id 'testdroid' version '3.38' apply true
818
}
919

1020
android {
11-
compileSdk 32
21+
compileSdk 34
1222

1323
defaultConfig {
1424
applicationId "com.example.myapplication"
1525
minSdk 21
16-
targetSdk 32
26+
targetSdk 34
1727
versionCode 1
1828
versionName "1.0"
1929

@@ -33,12 +43,13 @@ A typical project build.gradle will look like this:
3343
}
3444

3545
dependencies {
36-
implementation 'androidx.appcompat:appcompat:1.3.0'
37-
implementation 'com.google.android.material:material:1.4.0'
38-
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
39-
testImplementation 'junit:junit:4.13.2'
40-
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
41-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
46+
implementation 'androidx.appcompat:appcompat:1.7.0'
47+
implementation 'com.google.android.material:material:1.12.0'
48+
implementation 'androidx.constraintlayout:constraintlayout:2.2.0'
49+
testImplementation 'org.junit.jupiter:junit-jupiter:5.11.4'
50+
testImplementation 'junit:junit:4.12'
51+
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
52+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
4253
}
4354

4455
testdroid {
@@ -50,13 +61,14 @@ A typical project build.gradle will look like this:
5061
deviceGroup 'My devices'
5162
}
5263

53-
54-
55-
With above configuration your application and instrumentation package
64+
With above configuration your application and instrumentation package
5665
are uploaded into BitBar Cloud and test run is launched using device from group 'My Devices'
5766

58-
To launch test run from command line use testdroidUpload task:
59-
>./gradlew testdroidUpload
67+
To launch test run from command line use task:
68+
69+
```bash
70+
./gradlew testdroidUpload
71+
```
6072

6173
You can fully control your testrun using the same configurations options which are available via BitBar Cloud web UI.
6274

build.gradle

Lines changed: 37 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ apply plugin: 'maven-publish'
44
apply plugin: 'signing'
55
apply plugin: 'java-gradle-plugin'
66

7-
project.group = GROUP_ID
8-
project.archivesBaseName = ARTIFACT_ID
9-
project.version = VERSION_NAME
7+
group = GROUP_ID
8+
version = VERSION_NAME
9+
10+
base {
11+
archivesName = ARTIFACT_ID
12+
}
1013

1114
repositories {
1215
mavenCentral()
@@ -23,47 +26,47 @@ dependencies {
2326
gradleApi gradleApi()
2427
groovy localGroovy()
2528

26-
implementation 'com.android.tools.build:builder-test-api:8.2.2'
27-
implementation 'com.android.tools:annotations:31.2.2'
28-
implementation 'com.testdroid:testdroid-api:3.26'
29-
implementation 'com.google.guava:guava:31.1-jre'
30-
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2'
31-
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.10.2'
32-
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.10.2'
33-
testImplementation 'com.android.tools.build:gradle:8.2.2'
34-
testImplementation 'com.android.tools.build:gradle-core:3.1.4'
35-
36-
implementation 'com.google.protobuf:protobuf-java:3.21.8'
37-
38-
testImplementation 'io.netty:netty-codec-http:4.1.106.Final'
39-
testImplementation 'io.netty:netty-codec-http2:4.1.106.Final'
40-
testImplementation 'com.google.code.gson:gson:2.9.0'
41-
testImplementation 'commons-io:commons-io:2.11.0'
42-
testImplementation 'org.apache.commons:commons-compress:1.21'
43-
testImplementation 'org.jsoup:jsoup:1.17.2'
29+
implementation 'com.android.tools.build:builder-test-api:8.8.1'
30+
implementation 'com.android.tools:annotations:31.8.1'
31+
implementation 'com.testdroid:testdroid-api:3.38.0'
32+
implementation 'com.google.guava:guava:33.4.0-jre'
33+
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.11.4'
34+
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.11.4'
35+
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.11.4'
36+
testImplementation 'com.android.tools.build:gradle:8.8.1'
37+
38+
implementation 'com.google.protobuf:protobuf-java:4.29.3'
39+
40+
testImplementation 'io.netty:netty-codec-http:4.1.118.Final'
41+
testImplementation 'io.netty:netty-codec-http2:4.1.118.Final'
42+
testImplementation 'com.google.code.gson:gson:2.12.1'
43+
testImplementation 'commons-io:commons-io:2.18.0'
44+
testImplementation 'org.apache.commons:commons-compress:1.27.1'
45+
testImplementation 'org.jsoup:jsoup:1.18.3'
4446
testImplementation 'org.jdom:jdom2:2.0.6.1'
4547
testImplementation 'xerces:xercesImpl:2.12.2'
46-
testImplementation 'com.google.crypto.tink:tink:1.6.1'
47-
48-
// force newer versions due to security issues in gradle-core:3.1.4:
49-
testImplementation 'org.jetbrains.kotlin:kotlin-stdlib:1.9.22'
50-
testImplementation 'org.jetbrains.kotlin:kotlin-reflect:1.9.22'
51-
testImplementation 'commons-codec:commons-codec:1.16.1'
48+
testImplementation 'com.google.crypto.tink:tink:1.16.0'
5249
}
5350

5451
gradlePlugin {
52+
website = 'https://github.com/bitbar/android-gradle-plugin'
53+
vcsUrl = 'https://github.com/bitbar/android-gradle-plugin.git'
5554
plugins {
5655
testdroid {
56+
displayName = 'Testdroid Gradle Plugin'
57+
description = 'Gradle plugin to deploys apks to BitBar cloud and launches test run'
58+
tags.set(['android', 'bitbar', 'testdroid', 'cloud', 'testing'])
5759
id = 'testdroid'
5860
implementationClass = 'com.testdroid.TestDroidPlugin'
5961

6062
}
6163
}
62-
automatedPublishing = false
64+
automatedPublishing = project.hasProperty("enableAutoPublish")
6365
}
6466

6567
// custom tasks for creating source/javadoc jars
66-
task sourcesJar(type: Jar, dependsOn: classes) {
68+
tasks.register('sourcesJar', Jar) {
69+
dependsOn classes
6770
archiveClassifier.set('sources')
6871
from sourceSets.main.allSource
6972
}
@@ -76,11 +79,12 @@ javadoc {
7679
}
7780

7881
java {
79-
sourceCompatibility = JavaVersion.VERSION_11
80-
targetCompatibility = JavaVersion.VERSION_11
82+
sourceCompatibility = JavaVersion.VERSION_17
83+
targetCompatibility = JavaVersion.VERSION_17
8184
}
8285

83-
task javadocJar(type: Jar, dependsOn: javadoc) {
86+
tasks.register('javadocJar', Jar) {
87+
dependsOn javadoc
8488
archiveClassifier = 'javadoc'
8589
from javadoc.destinationDir
8690
}
@@ -121,7 +125,7 @@ publishing {
121125
license {
122126
name = POM_LICENSE_NAME
123127
url = POM_LICENSE_URL
124-
distribution = POM_LICENSE_DSITRIBUTIION
128+
distribution = POM_LICENSE_DISTRIBUTION
125129
}
126130
}
127131

@@ -130,11 +134,6 @@ publishing {
130134
name = 'Sakari Rautiainen'
131135
}
132136
}
133-
scm {
134-
url = POM_SCM_URL
135-
connection = POM_SCM_CONNECTION
136-
developerConnection = POM_SCM_DEVELOPER_CONNECTION
137-
}
138137
}
139138
}
140139
}

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION_NAME=3.26
1+
VERSION_NAME=3.38.0
22
GROUP_ID=com.testdroid
33
ARTIFACT_ID=gradle
44

@@ -12,4 +12,4 @@ POM_SCM_DEVELOPER_CONNECTION=scm:git@github.com:bitbar/android-gradle-plugin.git
1212

1313
POM_LICENSE_NAME=The Apache Software License, Version 2.0
1414
POM_LICENSE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
15-
POM_LICENSE_DSITRIBUTIION=repo
15+
POM_LICENSE_DISTRIBUTION=repo

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

tests/app/build.gradle

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
plugins {
22
id 'com.android.application'
3-
id 'testdroid' version '3.26' apply true
3+
id 'testdroid' version '3.38.0' apply true
44
}
55

66
android {
7-
compileSdk 32
7+
compileSdk 34
88
namespace 'com.example.myapplication'
99

1010
defaultConfig {
1111
applicationId "com.example.myapplication"
1212
minSdk 21
13-
targetSdk 32
13+
targetSdk 34
1414
versionCode 1
1515
versionName "1.0"
1616

@@ -30,12 +30,13 @@ android {
3030
}
3131

3232
dependencies {
33-
implementation 'androidx.appcompat:appcompat:1.3.0'
34-
implementation 'com.google.android.material:material:1.4.0'
35-
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
33+
implementation 'androidx.appcompat:appcompat:1.7.0'
34+
implementation 'com.google.android.material:material:1.12.0'
35+
implementation 'androidx.constraintlayout:constraintlayout:2.2.0'
36+
testImplementation 'org.junit.jupiter:junit-jupiter:5.11.4'
3637
testImplementation 'junit:junit:4.13.2'
37-
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
38-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
38+
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
39+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
3940
}
4041

4142
testdroid {

tests/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
android:roundIcon="@mipmap/ic_launcher_round"
1313
android:supportsRtl="true"
1414
android:theme="@style/Theme.MyApplication"
15-
tools:targetApi="32">
15+
tools:targetApi="34">
1616
<activity
1717
android:name=".MainActivity"
1818
android:exported="true">

tests/app/src/test/java/com/example/myapplication/ExampleUnitTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import org.junit.Test;
44

5-
import static org.junit.Assert.*;
5+
import static org.junit.jupiter.api.Assertions.assertEquals;
66

77
/**
88
* Example local unit test, which will execute on the development machine (host).

tests/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ plugins {
44
id 'com.android.library' version '8.2.2' apply false
55
}
66

7-
task clean(type: Delete) {
8-
delete rootProject.buildDir
7+
tasks.register('clean', Delete) {
8+
delete rootProject.layout.buildDirectory
99
}

0 commit comments

Comments
 (0)