Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Consumer proguard rules, javadoc artifact #143

Merged
merged 3 commits into from
Jul 27, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ android {

buildTypes {
release {
minifyEnabled false
minifyEnabled true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should deliver a proguarded version of the library. It personal drives me insane if I can't Ctrl + B a method and get the uncompiled/unobfuscated raw source code.

We have minifyEnabled false in FirebaseUI with a consumerProguardFile so the dev can decide to obfuscate their app if they want, but still develop it with the library source code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the app, not the library.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh lol. Oops! 😄

proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
buildscript {
repositories {
jcenter()
google()
maven { url 'https://maven.google.com' }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samtstern Any reason we added the more verbose version of the repo instead of keeping google()?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because when I use google() my build fails and I didn't feel like figuring out why :-)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha, SGTM 😄

}

dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha1'
classpath 'com.android.tools.build:gradle:3.0.0-alpha8'

classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
Expand All @@ -15,7 +15,7 @@ buildscript {
allprojects {
repositories {
jcenter()
google()
maven { url 'https://maven.google.com' }
}
}

Expand Down
2 changes: 1 addition & 1 deletion easypermissions/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ android {
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
consumerProguardFiles 'proguard-rules.pro'
}
}
}
Expand Down
12 changes: 12 additions & 0 deletions easypermissions/maven.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@ task sourcesJar(type: Jar) {
classifier = 'sources'
}

task javadoc(type: Javadoc) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to add failOnError = false for the build to work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep! Gonna see if I can actually fix the errors first and then add this.

source = android.sourceSets.main.java.srcDirs
classpath += configurations.compile
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

artifacts {
archives sourcesJar
archives javadocJar
}
20 changes: 3 additions & 17 deletions easypermissions/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
-keepclassmembers class * {
@pub.devrel.easypermissions.AfterPermissionGranted <methods>;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: add a new line at the bottom of the file

2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-rc-3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-milestone-1-all.zip