Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add automatic-module-name to relevant modules #281

Merged
merged 3 commits into from
Nov 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@
POM_NAME=AutoDispose (Android Architecture Components Test Extensions)
POM_ARTIFACT_ID=autodispose-android-archcomponents-test
POM_PACKAGING=aar
AUTOMATIC_MODULE_NAME=com.uber.autodispose.android.lifecycle.test
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@
POM_NAME=AutoDispose (Android Architecture Components Extensions)
POM_ARTIFACT_ID=autodispose-android-archcomponents
POM_PACKAGING=aar
AUTOMATIC_MODULE_NAME=com.uber.autodispose.android.lifecycle
1 change: 1 addition & 0 deletions android/autodispose-android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@
POM_NAME=AutoDispose (Android Extensions)
POM_ARTIFACT_ID=autodispose-android
POM_PACKAGING=aar
AUTOMATIC_MODULE_NAME=com.uber.autodispose.android
1 change: 1 addition & 0 deletions autodispose-rxlifecycle/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@
POM_NAME=AutoDispose (RxLifecycle Interop)
POM_ARTIFACT_ID=autodispose-rxlifecycle
POM_PACKAGING=jar
AUTOMATIC_MODULE_NAME=com.uber.autodispose.rxlifecycle
1 change: 1 addition & 0 deletions autodispose/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@
POM_NAME=AutoDispose
POM_ARTIFACT_ID=autodispose
POM_PACKAGING=jar
AUTOMATIC_MODULE_NAME=com.uber.autodispose
8 changes: 8 additions & 0 deletions gradle/gradle-mvn-push.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,14 @@ afterEvaluate { project ->
sign configurations.archives
}

if (hasProperty("AUTOMATIC_MODULE_NAME")) {
jar {
manifest {
attributes('Automatic-Module-Name': properties.get("AUTOMATIC_MODULE_NAME"))
}
}
}

if (project.getPlugins().hasPlugin('com.android.application') || project.getPlugins().
hasPlugin('com.android.library')) {
task install(type: Upload, dependsOn: assemble) {
Expand Down
1 change: 1 addition & 0 deletions lifecycle/autodispose-lifecycle-jdk8/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@
POM_NAME=AutoDispose (Lifecycle JDK8 Extensions)
POM_ARTIFACT_ID=autodispose-lifecycle-jdk8
POM_PACKAGING=jar
AUTOMATIC_MODULE_NAME=com.uber.autodispose.lifecycle.jdk8
1 change: 1 addition & 0 deletions lifecycle/autodispose-lifecycle/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@
POM_NAME=AutoDispose (Lifecycle)
POM_ARTIFACT_ID=autodispose-lifecycle
POM_PACKAGING=jar
AUTOMATIC_MODULE_NAME=com.uber.autodispose.lifecycle
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@
POM_NAME=AutoDispose Error-Prone Checker
POM_ARTIFACT_ID=autodispose-error-prone-checker
POM_PACKAGING=jar
AUTOMATIC_MODULE_NAME=com.uber.autodispose.errorprone
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.uber.autodispose.error.prone.checker;
package com.uber.autodispose.errorprone;

import com.google.auto.service.AutoService;
import com.google.common.collect.ImmutableList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
* limitations under the License.
*/

package com.uber.autodispose.error.prone.checker;
package com.uber.autodispose.errorprone;

public class ComponentWithLifeCycle {}
public class ComponentWithLifecycle {}
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* limitations under the License.
*/

package com.uber.autodispose.error.prone.checker;
package com.uber.autodispose.errorprone;

import com.google.common.collect.ImmutableList;
import com.google.errorprone.CompilationTestHelper;
import java.util.Collections;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
Expand All @@ -42,8 +42,8 @@ public class UseAutoDisposeTest {
}

@Test public void test_autodisposePositiveCaseswithCustomClass() {
compilationHelper.setArgs(Collections.singletonList(
"-XepOpt:ClassesWithScope" + "=com.uber.autodispose.error.prone.checker.ComponentWithLifeCycle"));
compilationHelper.setArgs(ImmutableList.of("-XepOpt:ClassesWithScope"
+ "=com.uber.autodispose.errorprone.ComponentWithLifecycle"));
compilationHelper.addSourceFile("UseAutoDisposeCustomClassPositiveCases.java")
.doTest();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@
* limitations under the License.
*/

package com.uber.autodispose.error.prone.checker;
package com.uber.autodispose.errorprone;

import com.uber.autodispose.errorprone.ComponentWithLifecycle;
import io.reactivex.Completable;
import io.reactivex.Flowable;
import io.reactivex.Maybe;
import io.reactivex.Observable;
import io.reactivex.Single;
import org.reactivestreams.Subscriber;

public class UseAutoDisposeCustomClassPositiveCases extends ComponentWithLifeCycle {
public class UseAutoDisposeCustomClassPositiveCases extends ComponentWithLifecycle {
public void observable_subscribeWithoutAutoDispose() {
Observable.empty()
// BUG: Diagnostic contains: Always apply an AutoDispose scope before subscribing within defined scoped elements.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
* limitations under the License.
*/

package com.uber.autodispose.error.prone.checker;
package com.uber.autodispose.errorprone;

import com.uber.autodispose.errorprone.UseAutoDispose;
import com.uber.autodispose.lifecycle.CorrespondingEventsFunction;
import com.uber.autodispose.lifecycle.LifecycleEndedException;
import com.uber.autodispose.lifecycle.LifecycleScopeProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
* limitations under the License.
*/

package com.uber.autodispose.error.prone.checker;
package com.uber.autodispose.errorprone;

import com.uber.autodispose.AutoDispose;
import com.uber.autodispose.errorprone.UseAutoDispose;
import com.uber.autodispose.lifecycle.CorrespondingEventsFunction;
import com.uber.autodispose.lifecycle.LifecycleEndedException;
import com.uber.autodispose.lifecycle.LifecycleScopeProvider;
Expand Down