Skip to content

Commit 870c1ce

Browse files
authored
Migration to Kotlin & More Development (#30)
* Move Kotlin plugin dependency into the general buildscript * Initial migration of the plugin's bulk to Kotlin * Cleanup, Groovy-Kotlin interop, tests etc. * Move to an underscore-less package * Progress with moving to distinct test modules * Finalize segmented testing through Gradle * Separated Run Configurations for test modules * Unify deployment scripts into a single file, shared by deployed modules * Parity of per-test logging in Sample tests * no message * Code Style * Lint & Removal of superfluous dependencies * Migrated Jacoco extension to Kotlin * Migrated over the remaining portions of the code that don't have to stay in Groovy * Kotlinify buildSrc task
1 parent 2bf3ac5 commit 870c1ce

File tree

54 files changed

+1684
-1171
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1684
-1171
lines changed

.idea/runConfigurations/Plugin__Run_Unit_Tests.xml renamed to .idea/runConfigurations/Plugin__Run_2_x_Unit_Tests.xml

Lines changed: 2 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/Plugin__Run_3_x_Unit_Tests.xml

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/Plugin__Run_All_Unit_Tests.xml

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ jdk:
2020
before_install:
2121
- echo "sdk.dir=$ANDROID_HOME" > local.properties
2222

23-
script: ./gradlew clean build --info --stacktrace
23+
script: ./gradlew clean build --stacktrace
2424

2525
after_success:
2626
- ./scripts/deploy_snapshot.sh
2727

2828
after_failure:
29-
- cat $TRAVIS_BUILD_DIR/android-junit5/build/reports/tests/test/index.html
30-
- cat $TRAVIS_BUILD_DIR/android-junit5/build/reports/tests/testAgp2x/index.html
31-
- cat $TRAVIS_BUILD_DIR/android-junit5/build/reports/tests/testAgp3x/index.html
29+
- cat $TRAVIS_BUILD_DIR/tests/testCommon/build/reports/tests/test/index.html
30+
- cat $TRAVIS_BUILD_DIR/tests/testAgp2x/build/reports/tests/test/index.html
31+
- cat $TRAVIS_BUILD_DIR/tests/testAgp3x/build/reports/tests/test/index.html
3232

3333
deploy:
3434
provider: script

android-junit5-embedded-runtime/build.gradle

Lines changed: 16 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -46,91 +46,19 @@ jar.dependsOn shadowJar
4646
// Releases are pushed to jcenter via Bintray, while snapshots are pushed to Sonatype OSS.
4747
// This section defines the necessary tasks to push new releases and snapshots using Gradle tasks.
4848
// ------------------------------------------------------------------------------------------------
49-
50-
// Include sources.jar archive in each release
51-
task sourcesJar(type: Jar, dependsOn: classes) {
52-
classifier = "sources"
53-
from sourceSets.main.allSource
54-
}
55-
56-
// Include javadoc.jar archive in each release
57-
task javadocJar(type: Jar, dependsOn: javadoc) {
58-
classifier = "javadoc"
59-
from javadoc.destinationDir
60-
}
61-
62-
artifacts {
63-
archives sourcesJar
64-
archives javadocJar
65-
}
66-
67-
version = VERSION_NAME
68-
69-
publishing {
70-
publications {
71-
library(MavenPublication) {
72-
project.shadow.component(it)
73-
}
74-
}
75-
}
76-
77-
// Copy POM to location expected by Bintray
78-
task copyPom(type: Copy) {
79-
from "build/publications/library"
80-
into "build/poms"
81-
include "pom-default.xml"
82-
}
83-
84-
publish.dependsOn copyPom
85-
86-
def verifyJarNotEmpty = {
87-
// Manually verify that the JAR file isn't "empty"
88-
// before attempting the upload. This happens on accidental
89-
// upload attempts without first deploying the shadowJar.
90-
def jarFile = new JarFile(shadowJar.archivePath)
91-
if (jarFile.getEntry("com") == null) {
92-
throw new AssertionError("The embedded-runtime JAR is empty!")
93-
}
94-
}
95-
96-
project.configure(project) {
97-
if (project.version.endsWith("-SNAPSHOT")) {
98-
// Configure deployment of snapshot versions to Sonatype OSS
99-
project.publishing {
100-
repositories {
101-
maven {
102-
name "snapshot"
103-
credentials {
104-
username project.ext.sonatypeUser
105-
password project.ext.sonatypePass
106-
}
107-
url "https://oss.sonatype.org/content/repositories/snapshots"
108-
}
109-
}
110-
}
111-
publish.doFirst verifyJarNotEmpty
112-
} else {
113-
// Configure deployment of release versions to Bintray
114-
project.bintray {
115-
user = project.ext.bintrayUser
116-
key = project.ext.bintrayKey
117-
configurations = ["archives"]
118-
dryRun = false
119-
pkg {
120-
repo = "maven"
121-
name = RUNTIME_ARTIFACT_ID
122-
userOrg = project.ext.bintrayUser
123-
licenses = [RUNTIME_LICENSE_NAME]
124-
publish = true
125-
publicDownloadNumbers = true
126-
vcsUrl = VCS_URL
127-
version {
128-
name = VERSION_NAME
129-
desc = RUNTIME_DESCRIPTION
130-
}
131-
}
132-
}
133-
134-
bintrayUpload.doFirst verifyJarNotEmpty
135-
}
136-
}
49+
project.ext.deployConfig = [artifactId : RUNTIME_ARTIFACT_ID,
50+
license : RUNTIME_LICENSE_NAME,
51+
description : RUNTIME_DESCRIPTION,
52+
beforePublishDo : {
53+
// Manually verify that the JAR file isn't "empty"
54+
// before attempting the upload. This happens on accidental
55+
// upload attempts without first deploying the shadowJar.
56+
def jarFile = new JarFile(shadowJar.archivePath)
57+
if (jarFile.getEntry("com") == null) {
58+
throw new AssertionError("The embedded-runtime JAR is empty!")
59+
}
60+
},
61+
mavenPublication: {
62+
project.shadow.component(it)
63+
}]
64+
apply from: "$rootDir/gradle/deployment.gradle"

0 commit comments

Comments
 (0)