Update Preinstrumented Jars to a new version
-
Ensure you have imported the gpg signing keys, and you have signing and release credentials in your
~/.gradle/gradle.properties
:signing.keyId=B408DBD5 signing.password=******** signing.secretKeyRingFile=/home/_____/.gnupg/secring.gpg systemProp.sonatype-login=******** systemProp.sonatype-password=********
Note, if you do not have
$HOME/.gnupg/secring.gpg
file, you may be running v2.1+ of GnuPG. If so you will need to export it using:gpg --keyring secring.gpg --export-secret-keys > ~/.gnupg/secring.gpg
-
Update
PREINSTRUMENTED_VERSION
insidebuildSrc/src/main/groovy/AndroidSdk.groovy
to the new versionclass AndroidSdk implements Comparable<AndroidSdk> { static final PREINSTRUMENTED_VERSION = 2
-
Build the new jars and publish them to your local maven repository
./gradlew :preinstrumented:instrumentAll PUBLISH_PREINSTRUMENTED_JARS=true ./gradlew :preinstrumented:publishToMavenLocal
Make sure that the new jars show up in the repository under
org/robolectric/android-all-instrumented
-
Update
DefaultSdkProvider.java
to use the new preinstrumented jar versionpublic class DefaultSdkProvider implements SdkProvider { private static final int RUNNING_JAVA_VERSION = Util.getJavaVersion(); private static final int PREINSTRUMENTED_VERSION = 2;
-
Run tests locally to make sure tests pass
./gradlew :robolectric:test
-
Upload the jars to Maven staging
PUBLISH_PREINSTRUMENTED_JARS=true ./gradlew :preinstrumented:publish
-
Log into Sonatype and close the staging repository.
-
Use the staging repository URL to test the uploaded artifacts. Add this to the
repositories
section in/build.gradle
:maven { url "https://oss.sonatype.org/content/repositories/orgrobolectric-____" }
-
Once you've confirmed that everything is ok, release the staging artifacts.
-
Wait for the new version to appear at Maven Central
-
Push the changes to
DefaultSdk.java
andAndroidSdk.groovy
and verify tests pass