Loading java/base.go +4 −5 Original line number Diff line number Diff line Loading @@ -748,10 +748,8 @@ func (j *Module) deps(ctx android.BottomUpMutatorContext) { // Kotlin files ctx.AddVariationDependencies(nil, kotlinStdlibTag, "kotlin-stdlib", "kotlin-stdlib-jdk7", "kotlin-stdlib-jdk8") if len(j.properties.Plugins) > 0 { ctx.AddVariationDependencies(nil, kotlinAnnotationsTag, "kotlin-annotations") } } // Framework libraries need special handling in static coverage builds: they should not have // static dependency on jacoco, otherwise there would be multiple conflicting definitions of Loading Loading @@ -1106,8 +1104,6 @@ func (j *Module) compile(ctx android.ModuleContext, aaptSrcJar android.Path) { flags.classpath = append(flags.classpath, deps.kotlinStdlib...) flags.classpath = append(flags.classpath, deps.kotlinAnnotations...) flags.dexClasspath = append(flags.dexClasspath, deps.kotlinAnnotations...) flags.kotlincClasspath = append(flags.kotlincClasspath, flags.bootClasspath...) flags.kotlincClasspath = append(flags.kotlincClasspath, flags.classpath...) Loading Loading @@ -1139,9 +1135,12 @@ func (j *Module) compile(ctx android.ModuleContext, aaptSrcJar android.Path) { // Jar kotlin classes into the final jar after javac if BoolDefault(j.properties.Static_kotlin_stdlib, true) { kotlinJars = append(kotlinJars, deps.kotlinStdlib...) kotlinJars = append(kotlinJars, deps.kotlinAnnotations...) kotlinHeaderJars = append(kotlinHeaderJars, deps.kotlinStdlib...) kotlinHeaderJars = append(kotlinHeaderJars, deps.kotlinAnnotations...) } else { flags.dexClasspath = append(flags.dexClasspath, deps.kotlinStdlib...) flags.dexClasspath = append(flags.dexClasspath, deps.kotlinAnnotations...) } } Loading java/kotlin_test.go +15 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,11 @@ func TestKotlin(t *testing.T) { } `) kotlinStdlib := ctx.ModuleForTests("kotlin-stdlib", "android_common"). Output("turbine-combined/kotlin-stdlib.jar").Output kotlinAnnotations := ctx.ModuleForTests("kotlin-annotations", "android_common"). Output("turbine-combined/kotlin-annotations.jar").Output fooKotlinc := ctx.ModuleForTests("foo", "android_common").Rule("kotlinc") fooJavac := ctx.ModuleForTests("foo", "android_common").Rule("javac") fooJar := ctx.ModuleForTests("foo", "android_common").Output("combined/foo.jar") Loading Loading @@ -69,6 +74,16 @@ func TestKotlin(t *testing.T) { fooJar.Inputs.Strings(), fooKotlincClasses.String()) } if !inList(kotlinStdlib.String(), fooJar.Inputs.Strings()) { t.Errorf("foo jar inputs %v does not contain %v", fooJar.Inputs.Strings(), kotlinStdlib.String()) } if !inList(kotlinAnnotations.String(), fooJar.Inputs.Strings()) { t.Errorf("foo jar inputs %v does not contain %v", fooJar.Inputs.Strings(), kotlinAnnotations.String()) } if !inList(fooKotlincHeaderClasses.String(), fooHeaderJar.Inputs.Strings()) { t.Errorf("foo header jar inputs %v does not contain %q", fooHeaderJar.Inputs.Strings(), fooKotlincHeaderClasses.String()) Loading Loading
java/base.go +4 −5 Original line number Diff line number Diff line Loading @@ -748,10 +748,8 @@ func (j *Module) deps(ctx android.BottomUpMutatorContext) { // Kotlin files ctx.AddVariationDependencies(nil, kotlinStdlibTag, "kotlin-stdlib", "kotlin-stdlib-jdk7", "kotlin-stdlib-jdk8") if len(j.properties.Plugins) > 0 { ctx.AddVariationDependencies(nil, kotlinAnnotationsTag, "kotlin-annotations") } } // Framework libraries need special handling in static coverage builds: they should not have // static dependency on jacoco, otherwise there would be multiple conflicting definitions of Loading Loading @@ -1106,8 +1104,6 @@ func (j *Module) compile(ctx android.ModuleContext, aaptSrcJar android.Path) { flags.classpath = append(flags.classpath, deps.kotlinStdlib...) flags.classpath = append(flags.classpath, deps.kotlinAnnotations...) flags.dexClasspath = append(flags.dexClasspath, deps.kotlinAnnotations...) flags.kotlincClasspath = append(flags.kotlincClasspath, flags.bootClasspath...) flags.kotlincClasspath = append(flags.kotlincClasspath, flags.classpath...) Loading Loading @@ -1139,9 +1135,12 @@ func (j *Module) compile(ctx android.ModuleContext, aaptSrcJar android.Path) { // Jar kotlin classes into the final jar after javac if BoolDefault(j.properties.Static_kotlin_stdlib, true) { kotlinJars = append(kotlinJars, deps.kotlinStdlib...) kotlinJars = append(kotlinJars, deps.kotlinAnnotations...) kotlinHeaderJars = append(kotlinHeaderJars, deps.kotlinStdlib...) kotlinHeaderJars = append(kotlinHeaderJars, deps.kotlinAnnotations...) } else { flags.dexClasspath = append(flags.dexClasspath, deps.kotlinStdlib...) flags.dexClasspath = append(flags.dexClasspath, deps.kotlinAnnotations...) } } Loading
java/kotlin_test.go +15 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,11 @@ func TestKotlin(t *testing.T) { } `) kotlinStdlib := ctx.ModuleForTests("kotlin-stdlib", "android_common"). Output("turbine-combined/kotlin-stdlib.jar").Output kotlinAnnotations := ctx.ModuleForTests("kotlin-annotations", "android_common"). Output("turbine-combined/kotlin-annotations.jar").Output fooKotlinc := ctx.ModuleForTests("foo", "android_common").Rule("kotlinc") fooJavac := ctx.ModuleForTests("foo", "android_common").Rule("javac") fooJar := ctx.ModuleForTests("foo", "android_common").Output("combined/foo.jar") Loading Loading @@ -69,6 +74,16 @@ func TestKotlin(t *testing.T) { fooJar.Inputs.Strings(), fooKotlincClasses.String()) } if !inList(kotlinStdlib.String(), fooJar.Inputs.Strings()) { t.Errorf("foo jar inputs %v does not contain %v", fooJar.Inputs.Strings(), kotlinStdlib.String()) } if !inList(kotlinAnnotations.String(), fooJar.Inputs.Strings()) { t.Errorf("foo jar inputs %v does not contain %v", fooJar.Inputs.Strings(), kotlinAnnotations.String()) } if !inList(fooKotlincHeaderClasses.String(), fooHeaderJar.Inputs.Strings()) { t.Errorf("foo header jar inputs %v does not contain %q", fooHeaderJar.Inputs.Strings(), fooKotlincHeaderClasses.String()) Loading