From 12d771c5d5b6212aa1eaccd63fda6a84732a03bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=20V=C3=A1zquez?= Date: Wed, 25 Jan 2017 23:03:13 +0100 Subject: [PATCH] Added no-op artifact (#5) * Added no-op artifact This artifact includes the same public class and method than the normal library, but has no code at all. It's useful to avoid including the library's code in the release APK. * Updated readme --- README.md | 3 +- library-no-op/build.gradle | 38 +++++++++++++++++++ library-no-op/src/main/AndroidManifest.xml | 4 ++ .../com/sloydev/preferator/Preferator.java | 11 ++++++ sample/build.gradle | 3 +- settings.gradle | 2 +- 6 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 library-no-op/build.gradle create mode 100644 library-no-op/src/main/AndroidManifest.xml create mode 100644 library-no-op/src/main/java/com/sloydev/preferator/Preferator.java diff --git a/README.md b/README.md index 440a541..c344b43 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,8 @@ Add it to your build.gradle: ```groovy dependencies{ - compile 'com.sloydev:preferator:1.0.0' + debugCompile 'com.sloydev:preferator:1.0.0' + releaseCompile 'com.sloydev:preferator-no-op:1.0.0' } ``` diff --git a/library-no-op/build.gradle b/library-no-op/build.gradle new file mode 100644 index 0000000..ee40f21 --- /dev/null +++ b/library-no-op/build.gradle @@ -0,0 +1,38 @@ +apply plugin: 'com.android.library' +apply plugin: 'com.novoda.bintray-release' + +sourceCompatibility = 1.7 + +android { + compileSdkVersion 23 + buildToolsVersion "23.0.1" + + defaultConfig { + minSdkVersion 15 + targetSdkVersion 23 + versionCode 1 + versionName "1.0" + + } + lintOptions { + abortOnError false + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_7 + targetCompatibility JavaVersion.VERSION_1_7 + } +} + +dependencies { + compile 'com.android.support:appcompat-v7:23.0.0' + +} + +publish { + userOrg = 'sloy' + groupId = 'com.sloydev' + artifactId = 'preferator-no-op' + publishVersion = '1.0.0' + desc = 'Edit your app\'s SharedPreferences from your device' + website = 'https://github.com/sloy/preferator' +} \ No newline at end of file diff --git a/library-no-op/src/main/AndroidManifest.xml b/library-no-op/src/main/AndroidManifest.xml new file mode 100644 index 0000000..3b1250d --- /dev/null +++ b/library-no-op/src/main/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + diff --git a/library-no-op/src/main/java/com/sloydev/preferator/Preferator.java b/library-no-op/src/main/java/com/sloydev/preferator/Preferator.java new file mode 100644 index 0000000..d21c44d --- /dev/null +++ b/library-no-op/src/main/java/com/sloydev/preferator/Preferator.java @@ -0,0 +1,11 @@ +package com.sloydev.preferator; + + +import android.content.Context; + +public class Preferator { + + public static void launch(Context context) { + // no-op + } +} diff --git a/sample/build.gradle b/sample/build.gradle index 4d7d1fd..62b89b1 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -26,5 +26,6 @@ android { dependencies { compile 'com.android.support:appcompat-v7:23.0.0' - compile project(':library') + debugCompile project(':library') + releaseCompile project(':library-no-op') } diff --git a/settings.gradle b/settings.gradle index 52baf7e..74891d4 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1 @@ -include ':sample', ':library' +include ':sample', ':library', ':library-no-op'