Skip to content

Commit 878ef92

Browse files
authored
Merge pull request #92 from wordpress-mobile/upgrade-to-gradle-7
Upgrade to gradle 7 & Android Gradle Plugin 4.2.2 & Add Buildkite
2 parents eebc5d8 + 90c0a1e commit 878ef92

File tree

9 files changed

+186
-227
lines changed

9 files changed

+186
-227
lines changed

.buildkite/pipeline.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
common-params:
2+
&docker-container
3+
docker#v3.8.0:
4+
image: "public.ecr.aws/automattic/android-build-image:v1.1.0"
5+
propagate-environment: true
6+
environment:
7+
# DO NOT MANUALLY SET THESE VALUES!
8+
# They are passed from the Buildkite agent to the Docker container
9+
- "AWS_ACCESS_KEY"
10+
- "AWS_SECRET_KEY"
11+
12+
steps:
13+
- label: "Lint & Checkstyle"
14+
key: "lint_and_checkstyle"
15+
plugins:
16+
- *docker-container
17+
command: |
18+
cp gradle.properties-example gradle.properties
19+
./gradlew lint checkstyle
20+
21+
- label: "Test"
22+
key: "test"
23+
plugins:
24+
- *docker-container
25+
command: |
26+
cp gradle.properties-example gradle.properties
27+
./gradlew test
28+
29+
- label: "Build and upload to S3"
30+
depends_on:
31+
- "lint_and_checkstyle"
32+
- "test"
33+
plugins:
34+
- *docker-container
35+
command: |
36+
cp gradle.properties-example gradle.properties
37+
./gradlew \
38+
:WordPressUtils:prepareToPublishToS3 $(prepare_to_publish_to_s3_params) \
39+
:WordPressUtils:publish

.circleci/config.yml

Lines changed: 0 additions & 66 deletions
This file was deleted.

WordPressUtils/build.gradle

Lines changed: 23 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,34 @@
1-
buildscript {
2-
ext.kotlinVersion = '1.4.10'
3-
ext.kotlin_ktx_version = '1.2.0'
4-
5-
repositories {
6-
google()
7-
jcenter()
8-
maven { url 'https://a8c-libs.s3.amazonaws.com/android' }
9-
}
10-
dependencies {
11-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
12-
classpath 'com.android.tools.build:gradle:4.0.2'
13-
classpath 'com.automattic.android:publish-to-s3:0.4.2'
14-
}
1+
plugins {
2+
id "com.android.library"
3+
id "org.jetbrains.kotlin.android"
4+
id "com.automattic.android.publish-to-s3"
155
}
166

17-
apply plugin: 'com.android.library'
18-
apply plugin: 'kotlin-android'
19-
apply plugin: 'kotlin-android-extensions'
20-
apply plugin: 'com.automattic.android.publish-library-to-s3'
7+
ext.kotlin_ktx_version = '1.5.0'
218

229
repositories {
2310
google()
24-
jcenter()
11+
mavenCentral()
12+
maven { url 'https://a8c-libs.s3.amazonaws.com/android' }
2513
}
2614

2715
dependencies {
2816
implementation 'org.apache.commons:commons-text:1.1'
29-
implementation 'com.android.volley:volley:1.1.1'
17+
implementation 'com.android.volley:volley:1.2.0'
3018
implementation 'com.google.android.material:material:1.2.1'
3119
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
3220
implementation 'androidx.recyclerview:recyclerview:1.0.0'
3321
implementation 'org.greenrobot:eventbus:3.0.0'
3422

3523
implementation "androidx.core:core-ktx:$kotlin_ktx_version"
36-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
24+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$gradle.ext.kotlinVersion"
3725

3826
testImplementation 'junit:junit:4.12'
3927
testImplementation 'org.assertj:assertj-core:3.11.1'
4028
testImplementation "org.robolectric:robolectric:4.4"
4129
testImplementation 'androidx.test:core:1.0.0'
4230

43-
lintChecks 'org.wordpress:lint:1.0.1'
31+
lintChecks 'org.wordpress:lint:1.1.0'
4432
androidTestImplementation 'androidx.test:runner:1.1.0'
4533
androidTestImplementation 'androidx.test:rules:1.1.0'
4634
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
@@ -70,26 +58,22 @@ android {
7058
}
7159
}
7260

73-
android.libraryVariants.all { variant ->
74-
task("generate${variant.name}Javadoc", type: Javadoc) {
75-
description "Generates Javadoc for $variant.name."
76-
source = variant.javaCompile.source
61+
project.afterEvaluate {
62+
publishing {
63+
publications {
64+
UtilsPublication(MavenPublication) {
65+
from components.release
7766

78-
options {
79-
links "http://docs.oracle.com/javase/7/docs/api/"
67+
groupId "org.wordpress"
68+
artifactId "utils"
69+
// version is set by 'publish-to-s3' plugin
70+
}
8071
}
81-
exclude '**/R.java'
82-
doFirst {
83-
classpath =
84-
files(variant.javaCompile.classpath.files,
85-
project.android.getBootClasspath())
86-
}
87-
}
72+
}
8873
}
8974

90-
s3PublishLibrary {
91-
groupId "org.wordpress"
92-
artifactId "utils"
93-
from "release"
75+
publishToS3Plugin {
76+
mavenPublishGroupId "org.wordpress"
77+
mavenPublishArtifactId "utils"
9478
}
9579

build.gradle

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,10 @@
1-
buildscript {
2-
repositories {
3-
jcenter()
4-
}
5-
6-
dependencies {
7-
classpath 'com.automattic.android:fetchstyle:1.1'
8-
}
1+
plugins {
2+
id "com.automattic.android.fetchstyle"
93
}
104

11-
apply plugin: 'com.automattic.android.fetchstyle'
12-
135
allprojects {
146
apply plugin: 'checkstyle'
157

16-
repositories {
17-
jcenter()
18-
maven {
19-
url "https://maven.google.com"
20-
}
21-
}
22-
238
if (tasks.findByPath('checkstyle') == null) {
249
tasks.create(name: 'checkstyle', type: Checkstyle) {
2510
source 'src'

gradle/wrapper/gradle-wrapper.jar

508 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

gradlew

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ esac
8282

8383
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
8484

85+
8586
# Determine the Java command to use to start the JVM.
8687
if [ -n "$JAVA_HOME" ] ; then
8788
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@@ -129,6 +130,7 @@ fi
129130
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
130131
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
131132
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133+
132134
JAVACMD=`cygpath --unix "$JAVACMD"`
133135

134136
# We build the pattern for arguments to be converted via cygpath

0 commit comments

Comments
 (0)