Skip to content
Open
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
d57983b
Added standalone tests for SBT import
ajaychandran Jul 20, 2025
55eb124
Rebase
ajaychandran Jul 29, 2025
5410f43
Merged code from new modules in to existing ones
ajaychandran Jul 31, 2025
2e82d15
Restored log statement required by examples
ajaychandran Jul 31, 2025
a2b17d2
Updated failing example
ajaychandran Jul 31, 2025
0c135ff
Cleanup
ajaychandran Aug 1, 2025
18b0e78
Refined core design and extended cross development support.
ajaychandran Aug 7, 2025
ff61532
Cleanup
ajaychandran Aug 7, 2025
6e10b2d
Removed build transformation options.
ajaychandran Aug 7, 2025
2113a73
Cleanup
ajaychandran Aug 7, 2025
50ec630
Updated incomplete example
ajaychandran Aug 7, 2025
d90a39a
Cleanup
ajaychandran Aug 7, 2025
997ee71
Added base trait and merge features, fixed issue with missing modules…
ajaychandran Aug 9, 2025
f3802b8
Cleanup
ajaychandran Aug 11, 2025
3948dbb
Render output using concatenation
ajaychandran Aug 14, 2025
335bca9
Updated Gradle implementation
ajaychandran Aug 20, 2025
aa3c626
Cleanup
ajaychandran Aug 21, 2025
fcf163b
Set .mill-jvm-version for Mockito tests
ajaychandran Aug 21, 2025
63731fb
Set .mill-jvm-version for Fluency example
ajaychandran Aug 21, 2025
59055b7
Updated Maven conversion
ajaychandran Aug 29, 2025
cce84a5
Cleanup
ajaychandran Aug 29, 2025
5a889fc
Fix mima
ajaychandran Aug 31, 2025
199b26e
Revert name change
ajaychandran Sep 1, 2025
d8c8089
Updated Scaladocs
ajaychandran Sep 2, 2025
9f49707
Eliminated MiMa filters
ajaychandran Sep 2, 2025
6bfd04c
Cleanup
ajaychandran Sep 2, 2025
66f7bf9
Reinstated mill-jvm-version in build header and added lower bound for…
ajaychandran Sep 2, 2025
aeb3fbb
Merge remote-tracking branch 'upstream/main' into importer
ajaychandran Sep 2, 2025
fa2a015
Added fixes for binary compatibility
ajaychandran Sep 2, 2025
a2b0e1e
Added/updated tests
ajaychandran Oct 1, 2025
3f5062e
Merge remote-tracking branch 'upstream/main' into importer
ajaychandran Oct 1, 2025
654591f
Cleanup
ajaychandran Oct 1, 2025
90380c3
Merge remote-tracking branch 'upstream/main' into importer
ajaychandran Oct 4, 2025
f959ba3
Cleanup
ajaychandran Oct 4, 2025
910c330
docs
ajaychandran Oct 4, 2025
9480498
Cleanup
ajaychandran Oct 4, 2025
c87bf31
Merge remote-tracking branch 'upstream/main' into importer
ajaychandran Oct 5, 2025
fb85b6a
Refactored and simplified new build representations
ajaychandran Oct 5, 2025
93cbb5c
Merge remote-tracking branch 'upstream/main' into importer
ajaychandran Oct 12, 2025
5be1e0a
Cleanup
ajaychandran Oct 12, 2025
605f908
Merge remote-tracking branch 'upstream/main' into importer
ajaychandran Oct 13, 2025
623448e
Cleanup
ajaychandran Oct 13, 2025
463f508
Updated base module name generation to use fixed "Project" prefix whe…
ajaychandran Oct 13, 2025
e07804a
Removed unused files in test resources
ajaychandran Oct 13, 2025
9789f5a
Change nullable fields in `PomSettings` to `Option`s.
ajaychandran Oct 13, 2025
f9f3213
Cleanup render for configurations with single value
ajaychandran Oct 13, 2025
a492ad8
Skip generating root build file for meta-build
ajaychandran Oct 13, 2025
59b7524
Skip emitting header setting for `mill-jvm-opts` when the value is empty
ajaychandran Oct 13, 2025
eea294a
Simplify regexes used in `split`
ajaychandran Oct 13, 2025
e8fd0cf
Include `TestConfig` fields for golden tests
ajaychandran Oct 13, 2025
3682bbb
Merge remote-tracking branch 'upstream/main' into importer
ajaychandran Oct 13, 2025
4131f6f
Disable configuration check on CI
ajaychandran Oct 13, 2025
cb1857f
Revert change
ajaychandran Oct 14, 2025
828df54
Avoided creating the same list multiple times
ajaychandran Oct 15, 2025
9306958
Combined multiple `Seq.filter` into one.
ajaychandran Oct 15, 2025
fef54c6
Inlined constant value
ajaychandran Oct 15, 2025
593caa0
Refactored integration tests
ajaychandran Oct 16, 2025
388f4d0
Merge remote-tracking branch 'upstream/main' into importer
ajaychandran Oct 16, 2025
39fa1f9
Defined alternate entry point for conversion.
ajaychandran Oct 17, 2025
35e5bc9
Added annotations for return types.
ajaychandran Oct 17, 2025
deb22ad
Merge remote-tracking branch 'upstream/main' into importer
ajaychandran Oct 17, 2025
083c925
Added sbt.api module for exported types.
ajaychandran Oct 17, 2025
cc29eef
Switch to Scala 3 dialect for code generation/formatting.
ajaychandran Oct 17, 2025
3e60aca
Fix formatting in golden files
ajaychandran Oct 17, 2025
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
3 changes: 3 additions & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ project {
"glob:**/example/**/*-spotless*/**",
"glob:**/javalib/test/resources/checkstyle/**",
"glob:**/init/test/resources/giter8/hello.g8/src/main/g8/build.mill",
"glob:**/init/gradle/test/resources/**",
"glob:**/init/maven/test/resources/**",
"glob:**/init/sbt/test/resources/**",
"glob:**/javalib/test/resources/javalib/palantirformat/**",
"glob:**/integration/failure/parse-error/**",
"glob:**/testkit/test/resources/example-test-example-project/build.mill",
Expand Down
4 changes: 3 additions & 1 deletion example/migrating/javalib/3-maven-complete-large/build.mill
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
> git remote add -f origin https://github.com/iluwatar/java-design-patterns
> git checkout ede37bd05568b1b8b814d8e9a1d2bbd71d9d615d

> ./mill init --jvm-id 21 # Repo needs Java >=21 to build and test
> ./mill init

> echo 21 > .mill-jvm-version # Repo needs Java >=21 to build and test

> rm twin/src/test/java/com/iluwatar/twin/BallThreadTest.java # skip flaky test
> rm actor-model/src/test/java/com/iluwatar/actor/ActorModelTest.java # skip flaky test
Expand Down
2 changes: 1 addition & 1 deletion example/migrating/javalib/4-gradle-complete/build.mill
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
> git remote add -f origin https://github.com/komamitsu/fluency.git
> git checkout 2.7.3 # multi-module Java project that requires Java 16+

> ./mill init --base-module FluencyModule --jvm-id 16
> ./mill init
converting Gradle build
...
init completed, run "mill resolve _" to list available tasks
Expand Down
9 changes: 4 additions & 5 deletions example/migrating/javalib/5-gradle-incomplete/build.mill
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@

> git init .
> git remote add -f origin https://github.com/mockito/mockito.git
> git checkout v5.15.2 # multi-module Java project that requires Java 17+
> git checkout v5.19.0 # multi-module Java project

> ./mill init --base-module MockitoModule --jvm-id 17 # init ignores custom dependency configurations
> ./mill init --gradle-jvm-id 17 # imported modules are not fully functional
converting Gradle build
ignoring errorprone dependency (com.google.errorprone,error_prone_core,2.23.0)
init completed, run "mill resolve _" to list available tasks

> ./mill __.compile # compilation error can be by fixed by using the Mill plugin for ErrorProne
error: plug-in not found: ErrorProne
> ./mill mockito-core.compile # module jvmId needs tweaking
error: java.lang.UnsupportedClassVersionError: com/google/errorprone/ErrorProneJavacPlugin has been compiled by a more recent version...
*/
12 changes: 5 additions & 7 deletions example/migrating/scalalib/2-sbt-incomplete/build.mill
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@
> rm build.mill # remove any existing build file

> git init .
> git remote add -f origin https://github.com/tototoshi/scala-csv.git
> git checkout 2.0.0
> git remote add -f origin https://github.com/fthomas/refined.git
> git checkout v0.11.3

> ./mill init
converting sbt build
...
init completed, run "mill resolve _" to list available tasks

> ./mill compile # You will have to further configure the `CrossScalaModule` for different Scala versions
compiling 7 Scala sources and 3 Java sources to ...
error: class CSVReader protected (private val lineReader: LineReader)(implicit format: CSVFormat) extends Closeable with CSVReaderCompat {
error: ^
error: one error found
> ./mill modules.core.jvm[2.12.20].compile # source roots for custom version ranges need tweaking
compiling 22 Scala sources to ...
error: ...object boolean is not a member of package eu.timepit.refined
*/
35 changes: 35 additions & 0 deletions integration/manual/migrating/src/MillInitGradleAsmTests.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package mill.integration

import mill.testkit.GitRepoIntegrationTestSuite
import utest.*

object MillInitGradleAsmTests extends GitRepoIntegrationTestSuite {
def tests = Tests {
test - integrationTestGitRepo(
// Gradle 8.3
"https://gitlab.ow2.org/asm/asm.git",
"ASM_9_8",
linkMillExecutable = true
) { tester =>
import tester.*

eval(
("init", "--gradle-jvm-id", "11"),
stdout = os.Inherit,
stderr = os.Inherit
).isSuccess ==> true
eval("__.showModuleDeps", stdout = os.Inherit, stderr = os.Inherit).isSuccess ==> true
eval("asm.compile", stdout = os.Inherit, stderr = os.Inherit).isSuccess ==> true

// tests are run using asm-test module?
eval("asm.test", stdout = os.Inherit, stderr = os.Inherit).isSuccess ==> false

// custom sourceSets not supported
eval(
"tools.retrofitter.compile",
stdout = os.Inherit,
stderr = os.Inherit
).isSuccess ==> false
}
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we consolidate the boilerplate code in these tests into a helper class? Each test object should only need to configure the git repo, version, and a list of (command: String, success: Boolean) tuples to specify what the test is meant to do

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I replaced the tests with notes describing known issues.
I am not sure why we need these tests anymore. Do you have a use-case in mind?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want the manual tests in case people want to run them in future. If not, how will anyone working on this code know whether these repos succeed or fail the import?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. The code was refactored.

27 changes: 27 additions & 0 deletions integration/manual/migrating/src/MillInitGradleEhcache3Tests.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package mill.integration

import mill.testkit.GitRepoIntegrationTestSuite
import utest.*

object MillInitGradleEhcache3Tests extends GitRepoIntegrationTestSuite {
def tests = Tests {
test - integrationTestGitRepo(
// Gradle 7.2
"https://github.com/ehcache/ehcache3.git",
"v3.10.8",
linkMillExecutable = true
) { tester =>
import tester.*

eval(
("init", "--gradle-jvm-id", "11"),
stdout = os.Inherit,
stderr = os.Inherit
).isSuccess ==> true
eval("__.showModuleDeps", stdout = os.Inherit, stderr = os.Inherit).isSuccess ==> true

// Gradle autoconfigures javac option -proc:none when -processorpath is not provided
eval("ehcache-api.compile", stdout = os.Inherit, stderr = os.Inherit).isSuccess ==> false
}
}
}
29 changes: 29 additions & 0 deletions integration/manual/migrating/src/MillInitGradleFastCsvTests.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package mill.integration

import mill.testkit.GitRepoIntegrationTestSuite
import utest.*

object MillInitGradleFastCsvTests extends GitRepoIntegrationTestSuite {
def tests = Tests {
test - integrationTestGitRepo(
// Gradle 9.0.0-rc-1, ErrorProne
"https://github.com/osiegmar/FastCSV.git",
"v4.0.0",
linkMillExecutable = true
) { tester =>
import tester.*

// https://fastcsv.org/guides/contribution/
// requires JVM 25 as per docs, but it is missing in the coursier index
eval(
("init", "--gradle-jvm-id", "24"),
stdout = os.Inherit,
stderr = os.Inherit
).isSuccess ==> true
eval("__.showModuleDeps", stdout = os.Inherit, stderr = os.Inherit).isSuccess ==> true

// Gradle autoconfigures javac option -proc:none when -processorpath is not provided
eval("lib.compile", stdout = os.Inherit, stderr = os.Inherit).isSuccess ==> false
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package mill.integration

import mill.testkit.GitRepoIntegrationTestSuite
import utest.*

object MillInitGradleJCommanderTests extends GitRepoIntegrationTestSuite {
def tests = Tests {
// Gradle 8.9
test - integrationTestGitRepo(
"https://github.com/cbeust/jcommander.git",
"2.0",
linkMillExecutable = true
) { tester =>
import tester.*

eval(
("init", "--gradle-jvm-id", "11"),
stdout = os.Inherit,
stderr = os.Inherit
).isSuccess ==> true
eval("compile", stdout = os.Inherit, stderr = os.Inherit).isSuccess ==> true

// annotations defined in main-module cannot be used in test-module?
eval("test.compile", stdout = os.Inherit, stderr = os.Inherit).isSuccess ==> false
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package mill.integration

import mill.testkit.GitRepoIntegrationTestSuite
import utest.*

object MillInitGradleMicroconfigTests extends GitRepoIntegrationTestSuite {
def tests = Tests {
// Gradle 8.10.1
test - integrationTestGitRepo(
"https://github.com/microconfig/microconfig.git",
"v4.9.5",
linkMillExecutable = true
) { tester =>
import tester.*

eval(
("init", "--gradle-jvm-id", "11"),
stdout = os.Inherit,
stderr = os.Inherit
).isSuccess ==> true
eval("__.showModuleDeps", stdout = os.Inherit, stderr = os.Inherit).isSuccess ==> true
eval("__.compile", stdout = os.Inherit, stderr = os.Inherit).isSuccess ==> true
eval("__.test", stdout = os.Inherit, stderr = os.Inherit).isSuccess ==> true
}
}
}
27 changes: 27 additions & 0 deletions integration/manual/migrating/src/MillInitGradleMockitoTests.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package mill.integration

import mill.testkit.GitRepoIntegrationTestSuite
import utest.*

object MillInitGradleMockitoTests extends GitRepoIntegrationTestSuite {
def tests = Tests {
test - integrationTestGitRepo(
// Gradle 8.14.2, BOM module
"https://github.com/mockito/mockito.git",
"v5.19.0",
linkMillExecutable = true
) { tester =>
import tester.*

eval(
("init", "--gradle-jvm-id", "17"),
stdout = os.Inherit,
stderr = os.Inherit
).isSuccess ==> true
eval("__.showModuleDeps", stdout = os.Inherit, stderr = os.Inherit).isSuccess ==> true

// ErrorProne requires JDK 17+ but module jvmId is 11
eval("mockito-core.compile", stdout = os.Inherit, stderr = os.Inherit).isSuccess ==> false
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package mill.integration

import mill.testkit.GitRepoIntegrationTestSuite
import utest.*

object MillInitGradlePCollectionsTests extends GitRepoIntegrationTestSuite {
def tests = Tests {
test - integrationTestGitRepo(
// Gradle 8.14.3
"https://github.com/hrldcpr/pcollections.git",
"v5.0.0",
linkMillExecutable = true
) { tester =>
import tester.*

eval(
("init", "--gradle-jvm-id", "17"),
stdout = os.Inherit,
stderr = os.Inherit
).isSuccess ==> true
eval("__.showModuleDeps", stdout = os.Inherit, stderr = os.Inherit).isSuccess ==> true
eval("compile", stdout = os.Inherit, stderr = os.Inherit).isSuccess ==> true

// typos in class names
eval("javadocGenerated", stdout = os.Inherit, stderr = os.Inherit).isSuccess ==> false
// mismatch between junit-jupiter-api and junit-platform-launcher (from sbt jupiter-interface)
eval("test", stdout = os.Inherit, stderr = os.Inherit).isSuccess ==> false
}
}
}
38 changes: 38 additions & 0 deletions integration/manual/migrating/src/MillInitGradleSpotbugsTests.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package mill.integration

import mill.testkit.GitRepoIntegrationTestSuite
import utest.*

object MillInitGradleSpotbugsTests extends GitRepoIntegrationTestSuite {

def tests = Tests {
test - integrationTestGitRepo(
// Gradle 9.0.0
"https://github.com/spotbugs/spotbugs.git",
"4.9.4",
linkMillExecutable = true
) { tester =>
import tester.*

eval(
("init", "--gradle-jvm-id", "17"),
stdout = os.Inherit,
stderr = os.Inherit
).isSuccess ==> true
eval("__.showModuleDeps", stdout = os.Inherit, stderr = os.Inherit).isSuccess ==> true
eval(
"spotbugs-annotations.compile",
stdout = os.Inherit,
stderr = os.Inherit
).isSuccess ==> true
eval(
"spotbugs-annotations.publishLocal",
stdout = os.Inherit,
stderr = os.Inherit
).isSuccess ==> true

// custom source folders not supported
eval("spotbugs-tests.test", stdout = os.Inherit, stderr = os.Inherit).isSuccess ==> false
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package mill.integration

import mill.testkit.GitRepoIntegrationTestSuite
import utest.*

object MillInitGradleSpringFrameworkTests extends GitRepoIntegrationTestSuite {

def tests = Tests {
test - integrationTestGitRepo(
// Gradle 8.14.3, ErrorProne
"https://github.com/spring-projects/spring-framework.git",
"v6.2.11",
linkMillExecutable = true
) { tester =>
import tester.*

eval(
("init", "--gradle-jvm-id", "24"),
stdout = os.Inherit,
stderr = os.Inherit
).isSuccess ==> true
eval("__.showModuleDeps", stdout = os.Inherit, stderr = os.Inherit).isSuccess ==> true

// BomModule not supported
eval("spring-core.compile", stdout = os.Inherit, stderr = os.Inherit).isSuccess ==> false
}
}
}
23 changes: 23 additions & 0 deletions integration/manual/migrating/src/MillInitMavenAntlr4Tests.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package mill.integration

import mill.testkit.GitRepoIntegrationTestSuite
import utest.*

object MillInitMavenAntlr4Tests extends GitRepoIntegrationTestSuite {
def tests = Tests {
test - integrationTestGitRepo(
// polyglot project
"https://github.com/antlr/antlr4.git",
"4.13.2",
linkMillExecutable = true
) { tester =>
import tester.*

eval("init", stdout = os.Inherit, stderr = os.Inherit).isSuccess ==> true
eval("__.showModuleDeps", stdout = os.Inherit, stderr = os.Inherit).isSuccess ==> true

// custom layout not supported
eval("__.compile", stdout = os.Inherit, stderr = os.Inherit).isSuccess ==> false
}
}
}
24 changes: 24 additions & 0 deletions integration/manual/migrating/src/MillInitMavenByteBuddyTests.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package mill.integration

import mill.testkit.GitRepoIntegrationTestSuite
import utest.*

object MillInitMavenByteBuddyTests extends GitRepoIntegrationTestSuite {
def tests = Tests {
test - integrationTestGitRepo(
"https://github.com/raphw/byte-buddy.git",
"byte-buddy-1.17.7",
linkMillExecutable = true
) { tester =>
import tester.*

eval("init", stdout = os.Inherit, stderr = os.Inherit).isSuccess ==> true
eval("__.showModuleDeps", stdout = os.Inherit, stderr = os.Inherit).isSuccess ==> true
eval("byte-buddy-agent.test", stdout = os.Inherit, stderr = os.Inherit).isSuccess ==> true

// requires Android support
// Gradle plugin is built using Gradle
eval("__.compile", stdout = os.Inherit, stderr = os.Inherit).isSuccess ==> false
}
}
}
Loading