Skip to content

Commit

Permalink
Configure kotlin to be bsp compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
vaslabs committed Jan 20, 2025
1 parent 0a24d66 commit cd85eea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.os.Bundle
import android.view.Gravity
import android.view.ViewGroup.LayoutParams
import android.widget.TextView
import com.helloworld.SampleLogic

class MainActivity : Activity() {
override fun onCreate(savedInstanceState: Bundle?) {
Expand All @@ -17,7 +18,7 @@ class MainActivity : Activity() {
textView.text = getString(R.string.hello_world)

// Set text size
textView.textSize = 32f
textView.textSize = SampleLogic.textSize()

// Center the text within the view
textView.gravity = Gravity.CENTER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import mill.javalib.android.AndroidAppModule
trait AndroidAppKotlinModule extends AndroidAppModule with KotlinModule { outer =>

override def sources: T[Seq[PathRef]] =
super.sources() :+ PathRef(millSourcePath / "src/main/kotlin")
super[AndroidAppModule].sources() :+ PathRef(millSourcePath / "src/main/kotlin")

override def kotlincOptions = super.kotlincOptions() ++ {
if (androidEnableCompose()) {
Expand Down Expand Up @@ -54,7 +54,7 @@ trait AndroidAppKotlinModule extends AndroidAppModule with KotlinModule { outer

trait AndroidAppKotlinTests extends AndroidAppTests with KotlinTests {
override def sources: T[Seq[PathRef]] =
super.sources() :+ PathRef(outer.millSourcePath / "src/test/kotlin")
super[AndroidAppTests].sources() ++ Seq(PathRef(outer.millSourcePath / "src/test/kotlin"))
}

trait AndroidAppKotlinInstrumentedTests extends AndroidAppKotlinModule
Expand All @@ -64,6 +64,6 @@ trait AndroidAppKotlinModule extends AndroidAppModule with KotlinModule { outer
override final def androidSdkModule = outer.androidSdkModule

override def sources: T[Seq[PathRef]] =
super.sources() :+ PathRef(outer.millSourcePath / "src/androidTest/kotlin")
super[AndroidAppInstrumentedTests].sources() :+ PathRef(outer.millSourcePath / "src/androidTest/kotlin")
}
}

0 comments on commit cd85eea

Please sign in to comment.