File tree Expand file tree Collapse file tree
main/kotlin/com/squareup/wire/gradle/kotlin
kotlin/com/squareup/wire/gradle
projects/android-kotlin-source-release-jar
src/main/proto/squareup/geology Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -185,8 +185,6 @@ private class AndroidSource(
185185 }
186186 is KotlinTarget -> {
187187 variant.sources.kotlin?.addGeneratedSourceDirectory(wireTask) { it.outputDirectoriesList[index] }
188- // Remove line below when AGP is upgraded to 9.0+ as it will contain fix for https://issuetracker.google.com/446220448
189- variant.sources.java?.addGeneratedSourceDirectory(wireTask) { it.outputDirectoriesList[index] }
190188 }
191189 is CustomTarget -> {
192190 // Custom targets are wildcards, so we add all output directories.
Original file line number Diff line number Diff line change @@ -1378,6 +1378,22 @@ class WirePluginTest {
13781378 }
13791379 }
13801380
1381+ /* * Regression test for https://github.com/square/wire/issues/3558 */
1382+ @Test
1383+ fun androidKotlinSourceReleaseJarNoDuplicates () {
1384+ val fixtureRoot = File (" src/test/projects/android-kotlin-source-release-jar" )
1385+
1386+ val localProperties = File (fixtureRoot, " local.properties" )
1387+ if (! localProperties.exists()) {
1388+ val androidHome = System .getenv(" ANDROID_HOME" )
1389+ ? : " ${System .getProperty(" user.home" )} /Library/Android/sdk"
1390+ localProperties.writeText(" sdk.dir=$androidHome \n " )
1391+ }
1392+
1393+ val result = fixtureGradleRunner(fixtureRoot, " sourceReleaseJar" , " --no-build-cache" ).build()
1394+ assertThat(result.task(" :sourceReleaseJar" )?.outcome).isEqualTo(TaskOutcome .SUCCESS )
1395+ }
1396+
13811397 @Test
13821398 fun taskDependency () {
13831399 val fixtureRoot = File (" src/test/projects/task-dependency" )
Original file line number Diff line number Diff line change 1+ def wireVersion = gradle. startParameter. projectProperties. get(' wireVersion' )
2+
3+ buildscript {
4+ repositories {
5+ maven {
6+ url new File (rootDir, " ../../../../../build/localMaven" ). toURI(). toString()
7+ }
8+ google()
9+ mavenCentral()
10+ }
11+
12+ dependencies {
13+ classpath(" com.squareup.wire:wire-gradle-plugin:${ wireVersion} " )
14+ classpath(" com.android.tools.build:gradle:8.13.2" )
15+ classpath(" org.jetbrains.kotlin:kotlin-gradle-plugin:2.2.21" )
16+ }
17+ }
18+
19+ apply plugin : ' com.android.library'
20+ apply plugin : ' org.jetbrains.kotlin.android'
21+ apply plugin : ' com.squareup.wire'
22+ apply plugin : ' maven-publish'
23+
24+ android {
25+ namespace = " com.example.producer"
26+ compileSdk = 36
27+
28+ publishing {
29+ singleVariant(' release' ) {
30+ withSourcesJar()
31+ }
32+ }
33+ }
34+
35+ wire {
36+ kotlin {}
37+ }
Original file line number Diff line number Diff line change 1+ pluginManagement {
2+ repositories {
3+ maven {
4+ url new File (rootDir, " ../../../../../build/localMaven" ). toURI(). toString()
5+ }
6+ google()
7+ mavenCentral()
8+ }
9+ }
10+
11+ dependencyResolutionManagement {
12+ repositories {
13+ google {
14+ mavenContent {
15+ includeGroupAndSubgroups(" androidx" )
16+ includeGroupAndSubgroups(" com.android" )
17+ includeGroupAndSubgroups(" com.google" )
18+ }
19+ }
20+ mavenCentral()
21+ }
22+ }
Original file line number Diff line number Diff line change 1+ syntax = "proto2" ;
2+
3+ package squareup.geology ;
4+
5+ enum Period {
6+ JURASSIC = 1 ;
7+ CRETACEOUS = 2 ;
8+ }
You can’t perform that action at this time.
0 commit comments