Skip to content

Commit

Permalink
Added no-op artifact (#5)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Sloy authored Jan 25, 2017
1 parent 278250d commit 12d771c
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
```

Expand Down
38 changes: 38 additions & 0 deletions library-no-op/build.gradle
Original file line number Diff line number Diff line change
@@ -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'
}
4 changes: 4 additions & 0 deletions library-no-op/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.sloydev.library_no_op">

</manifest>
11 changes: 11 additions & 0 deletions library-no-op/src/main/java/com/sloydev/preferator/Preferator.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.sloydev.preferator;


import android.content.Context;

public class Preferator {

public static void launch(Context context) {
// no-op
}
}
3 changes: 2 additions & 1 deletion sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include ':sample', ':library'
include ':sample', ':library', ':library-no-op'

0 comments on commit 12d771c

Please sign in to comment.