Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify build #2512

Merged
merged 2 commits into from Nov 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
35 changes: 1 addition & 34 deletions build.sc
Expand Up @@ -834,7 +834,7 @@ trait Cli extends SbtModule with ProtoBuildModule with CliLaunchers
workingDir = os.pwd
)
val cp = res.out.trim()
cp.split(File.pathSeparator).toSeq.map(p => mill.PathRef(os.Path(p)))
cp.split(File.pathSeparator).toSeq.map(p => PathRef(os.Path(p)))
}

def localRepoJar = `local-repo`.localRepoJar()
Expand Down Expand Up @@ -869,20 +869,6 @@ trait CliIntegration extends SbtModule with ScalaCliPublishModule with HasTests
super.scalacOptions() ++ Seq("-Xasync", "-deprecation")
}

def modulesPath = T {
val name = mainArtifactName().stripPrefix(prefix)
val baseIntegrationPath = os.Path(millSourcePath.toString.stripSuffix(name))
baseIntegrationPath.toString.stripSuffix(baseIntegrationPath.baseName)
}
def sources = T.sources {
val mainPath = PathRef(os.Path(modulesPath()) / "integration" / "src" / "main" / "scala")
super.sources() ++ Seq(mainPath)
}
def resources = T.sources {
val mainPath = PathRef(os.Path(modulesPath()) / "integration" / "src" / "main" / "resources")
super.resources() ++ Seq(mainPath)
}

def ivyDeps = super.ivyDeps() ++ Agg(
Deps.osLib
)
Expand All @@ -909,25 +895,6 @@ trait CliIntegration extends SbtModule with ScalaCliPublishModule with HasTests
"SCALA_CLI_PRINT_STACK_TRACES" -> "1",
"SCALA_CLI_CONFIG" -> (tmpDirBase().path / "config" / "config.json").toString
)
private def updateRef(name: String, ref: PathRef): PathRef = {
val rawPath = ref.path.toString.replace(
File.separator + name + File.separator,
File.separator
)
PathRef(os.Path(rawPath))
}
def sources = T.sources {
val name = mainArtifactName().stripPrefix(prefix)
super.sources().flatMap { ref =>
Seq(updateRef(name, ref), ref)
}
}
def resources = T.sources {
val name = mainArtifactName().stripPrefix(prefix)
super.resources().flatMap { ref =>
Seq(updateRef(name, ref), ref)
}
}

def constantsFile = T.persistent {
val dir = T.dest / "constants"
Expand Down