Skip to content

Commit

Permalink
Revert "Support packaging proto files into android archives(aar) (#414)…
Browse files Browse the repository at this point in the history
…" (#437)

This reverts commit 15607b4.
  • Loading branch information
voidzcy authored Oct 2, 2020
1 parent 728b686 commit 6dbd5bd
Show file tree
Hide file tree
Showing 11 changed files with 3 additions and 302 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,6 @@ class ProtobufPlugin implements Plugin<Project> {
*/
private void addProtoTasks() {
if (Utils.isAndroidProject(project)) {
// Avoid packaging proto files into apk.
if (!project.android.hasProperty('libraryVariants')) {
project.android.packagingOptions.exclude("**/*.proto")
}

getNonTestVariants().each { variant ->
addTasksForVariant(variant, false)
}
Expand Down Expand Up @@ -276,8 +271,6 @@ class ProtobufPlugin implements Plugin<Project> {

variant.sourceSets.each {
setupExtractProtosTask(generateProtoTask, it.name)
// Add proto files to java resources, and package them into aar/classes.jar.
it.resources.srcDirs += generateProtoTask.sourceFiles
}

if (variant.hasProperty("compileConfiguration")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,8 @@ class ProtobufAndroidPluginTest extends Specification {
File testProjectLiteStaging = ProtobufPluginTestHelper.projectBuilder('testProjectLite')
.copyDirs('testProjectLite')
.build()
File testProjectAndroidLibrary = ProtobufPluginTestHelper.projectBuilder('testProjectAndroidLibrary')
.copyDirs('testProjectAndroidLibrary')
.build()
File mainProjectDir = ProtobufPluginTestHelper.projectBuilder('testProjectAndroidMain')
.copySubProjects(testProjectStaging, testProjectLiteStaging, testProjectAndroidStaging,
testProjectAndroidLibrary)
.copySubProjects(testProjectStaging, testProjectLiteStaging, testProjectAndroidStaging)
.withAndroidPlugin(agpVersion)
.build()
when: "build is invoked"
Expand Down Expand Up @@ -66,12 +62,8 @@ class ProtobufAndroidPluginTest extends Specification {
File testProjectLiteStaging = ProtobufPluginTestHelper.projectBuilder('testProjectLite')
.copyDirs('testProjectLite')
.build()
File testProjectAndroidLibrary = ProtobufPluginTestHelper.projectBuilder('testProjectAndroidLibrary')
.copyDirs('testProjectAndroidLibrary')
.build()
File mainProjectDir = ProtobufPluginTestHelper.projectBuilder('testProjectAndroidMain')
.copySubProjects(testProjectStaging, testProjectLiteStaging, testProjectAndroidStaging,
testProjectAndroidLibrary)
.copySubProjects(testProjectStaging, testProjectLiteStaging, testProjectAndroidStaging)
.withAndroidPlugin(agpVersion)
.build()
and:
Expand Down Expand Up @@ -130,12 +122,8 @@ class ProtobufAndroidPluginTest extends Specification {
File testProjectLiteStaging = ProtobufPluginTestHelper.projectBuilder('testProjectLite')
.copyDirs('testProjectLite')
.build()
File testProjectAndroidLibraryStaging = ProtobufPluginTestHelper.projectBuilder('testProjectAndroidLibrary')
.copyDirs('testProjectAndroidLibrary')
.build()
File mainProjectDir = ProtobufPluginTestHelper.projectBuilder('testProjectAndroidMain')
.copySubProjects(testProjectStaging, testProjectLiteStaging, testProjectAndroidStaging,
testProjectAndroidLibraryStaging)
.copySubProjects(testProjectStaging, testProjectLiteStaging, testProjectAndroidStaging)
.withAndroidPlugin(agpVersion)
.withKotlin(kotlinVersion)
.build()
Expand Down

This file was deleted.

3 changes: 0 additions & 3 deletions testProjectAndroidBase/build_base.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,6 @@ dependencies {
compile(project(':testProjectLite')) {
exclude module: "protobuf-lite"
}
compile(project(':testProjectAndroidLibrary')) {
exclude module: "protobuf-lite"
}
protobuf files('lib/protos.jar')
testCompile 'junit:junit:4.12'
}
Expand Down
7 changes: 0 additions & 7 deletions testProjectAndroidBase/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="io.grpc.helloaarexample.HelloAarActivity"
android:label="@string/app_name_aar" >
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
1 change: 0 additions & 1 deletion testProjectAndroidBase/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<resources>
<string name="app_name">GrpcHelloworldExample</string>
<string name="app_name_aar">GrpcHelloworldExampleForAar</string>
</resources>

This file was deleted.

95 changes: 0 additions & 95 deletions testProjectAndroidLibrary/build.gradle

This file was deleted.

1 change: 0 additions & 1 deletion testProjectAndroidLibrary/settings.gradle

This file was deleted.

5 changes: 0 additions & 5 deletions testProjectAndroidLibrary/src/main/AndroidManifest.xml

This file was deleted.

57 changes: 0 additions & 57 deletions testProjectAndroidLibrary/src/main/proto/helloAar.proto

This file was deleted.

0 comments on commit 6dbd5bd

Please sign in to comment.