Skip to content

Commit

Permalink
Merge branch 'main' into issue-3928
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshumahajan138 authored Nov 20, 2024
2 parents 5e96507 + 422ef40 commit 80cf5fb
Show file tree
Hide file tree
Showing 46 changed files with 1,673 additions and 365 deletions.
12 changes: 11 additions & 1 deletion build.mill
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,10 @@ object Deps {
val asmTree = ivy"org.ow2.asm:asm-tree:9.7.1"
val bloopConfig = ivy"ch.epfl.scala::bloop-config:1.5.5"

val coursier = ivy"io.get-coursier::coursier:2.1.16"
val coursierVersion = "2.1.16"
val coursier = ivy"io.get-coursier::coursier:$coursierVersion"
val coursierInterface = ivy"io.get-coursier:interface:1.0.22"
val coursierJvm = ivy"io.get-coursier::coursier-jvm:$coursierVersion"

val cask = ivy"com.lihaoyi::cask:0.9.4"
val castor = ivy"com.lihaoyi::castor:0.3.0"
Expand Down Expand Up @@ -192,6 +194,7 @@ object Deps {
val mavenResolverTransportFile = ivy"org.apache.maven.resolver:maven-resolver-transport-file:$mavenResolverVersion"
val mavenResolverTransportHttp = ivy"org.apache.maven.resolver:maven-resolver-transport-http:$mavenResolverVersion"
val mavenResolverTransportWagon = ivy"org.apache.maven.resolver:maven-resolver-transport-wagon:$mavenResolverVersion"
val coursierJvmIndexVersion = "0.0.4-70-51469f"

object RuntimeDeps {
val dokkaVersion = "1.9.20"
Expand Down Expand Up @@ -567,6 +570,13 @@ trait MillStableScalaModule extends MillPublishScalaModule with Mima {
// https://github.com/com-lihaoyi/mill/pull/3503
ProblemFilter.exclude[ReversedMissingMethodProblem](
"mill.scalalib.ScalaModule#ScalaTests.mill$scalalib$ScalaModule$ScalaTests$$super$mandatoryScalacOptions"
),
// Not sure why Mima is complaining when these are internal and private
ProblemFilter.exclude[Problem](
"*.bspJvmBuildTarget"
),
ProblemFilter.exclude[Problem](
"mill.scalalib.RunModule#RunnerImpl.*"
)
)
def mimaPreviousVersions: T[Seq[String]] = Settings.mimaBaseVersions
Expand Down
4 changes: 3 additions & 1 deletion contrib/jmh/src/mill/contrib/jmh/JmhModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ trait JmhModule extends JavaModule {
classPath = (runClasspath() ++ generatorDeps()).map(_.path) ++
Seq(compileGeneratedSources().path, resources),
mainArgs = args,
workingDir = T.ctx().dest
workingDir = T.ctx().dest,
javaHome = zincWorker().javaHome().map(_.path)
)
}

Expand Down Expand Up @@ -90,6 +91,7 @@ trait JmhModule extends JavaModule {
resourcesDir.toString,
"default"
),
javaHome = zincWorker().javaHome().map(_.path),
jvmArgs = forkedArgs
)

Expand Down
4 changes: 2 additions & 2 deletions contrib/sonatypecentral/readme.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ $ mill -i \
mill.contrib.sonatypecentral.SonatypeCentralPublishModule/publishAll \
--username myusername \
--password mypassword \
--gpgArgs --passphrase=$GPG_PASSPHRASE,--no-tty,--pinentry-mode,loopback,--batch,--yes,-a,-b \
--gpgArgs --passphrase=$MILL_PGP_PASSPHRASE,--no-tty,--pinentry-mode,loopback,--batch,--yes,-a,-b \
--publishArtifacts __.publishArtifacts \
--readTimeout 36000 \
--awaitTimeout 36000 \
Expand Down Expand Up @@ -68,7 +68,7 @@ The `mill.contrib.sonatypecentral.SonatypeCentralPublishModule/publishAll` metho

`password`: The password for calling the Sonatype Central publishing api. Defaults to the `SONATYPE_PASSWORD` environment variable if unset. If neither the parameter nor the environment variable are set, an error will be thrown. +

`gpgArgs`: Arguments to pass to the gpg package for signing artifacts. _Default: `--batch, --yes, -a, -b`._ +
`gpgArgs`: Arguments to pass to the gpg package for signing artifacts. Uses the `MILL_PGP_PASSPHRASE` environment variable if set. _Default: `[--passphrase=$MILL_PGP_PASSPHRASE], --no-tty, --pinentry-mode, loopback, --batch, --yes, -a, -b`._ +

`publishArtifacts`: The command for generating all publishable artifacts (ex. `__.publishArtifacts`). Required. +

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@ import mill.contrib.sonatypecentral.SonatypeCentralPublishModule.{
getPublishingTypeFromReleaseFlag,
getSonatypeCredentials
}
import mill.scalalib.PublishModule.defaultGpgArgs
import mill.scalalib.publish.Artifact
import mill.scalalib.publish.SonatypeHelpers.{
PASSWORD_ENV_VARIABLE_NAME,
USERNAME_ENV_VARIABLE_NAME
}

trait SonatypeCentralPublishModule extends PublishModule {
def sonatypeCentralGpgArgs: T[String] = Task { defaultGpgArgs.mkString(",") }
def sonatypeCentralGpgArgs: T[String] = Task {
PublishModule.defaultGpgArgsForPassphrase(T.env.get("MILL_PGP_PASSPHRASE")).mkString(",")
}

def sonatypeCentralConnectTimeout: T[Int] = Task { defaultConnectTimeout }

Expand All @@ -43,10 +44,7 @@ trait SonatypeCentralPublishModule extends PublishModule {
PublishModule.pgpImportSecretIfProvided(T.env)
val publisher = new SonatypeCentralPublisher(
credentials = finalCredentials,
gpgArgs = sonatypeCentralGpgArgs() match {
case "" => PublishModule.defaultGpgArgsForPassphrase(T.env.get("PGP_PASSPHRASE"))
case gpgArgs => gpgArgs.split(",").toIndexedSeq
},
gpgArgs = sonatypeCentralGpgArgs().split(",").toIndexedSeq,
connectTimeout = sonatypeCentralConnectTimeout(),
readTimeout = sonatypeCentralReadTimeout(),
log = T.log,
Expand Down Expand Up @@ -75,7 +73,7 @@ object SonatypeCentralPublishModule extends ExternalModule {
username: String = defaultCredentials,
password: String = defaultCredentials,
shouldRelease: Boolean = defaultShouldRelease,
gpgArgs: String = defaultGpgArgs.mkString(","),
gpgArgs: String = "",
readTimeout: Int = defaultReadTimeout,
connectTimeout: Int = defaultConnectTimeout,
awaitTimeout: Int = defaultAwaitTimeout,
Expand All @@ -93,7 +91,7 @@ object SonatypeCentralPublishModule extends ExternalModule {
val publisher = new SonatypeCentralPublisher(
credentials = finalCredentials,
gpgArgs = gpgArgs match {
case "" => PublishModule.defaultGpgArgsForPassphrase(T.env.get("PGP_PASSPHRASE"))
case "" => PublishModule.defaultGpgArgsForPassphrase(T.env.get("MILL_PGP_PASSPHRASE"))
case gpgArgs => gpgArgs.split(",").toIndexedSeq
},
connectTimeout = connectTimeout,
Expand Down
4 changes: 3 additions & 1 deletion docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
** xref:javalib/publishing.adoc[]
** xref:javalib/build-examples.adoc[]
** xref:javalib/web-examples.adoc[]
* xref:scalalib/intro.adoc[]
** xref:scalalib/module-config.adoc[]
** xref:scalalib/dependencies.adoc[]
Expand All @@ -36,12 +37,12 @@
** xref:comparisons/gradle.adoc[]
** xref:comparisons/sbt.adoc[]
** xref:comparisons/unique.adoc[]
** xref:comparisons/java-compile.adoc[]
* The Mill CLI
** xref:cli/installation-ide.adoc[]
** xref:cli/flags.adoc[]
** xref:cli/builtin-commands.adoc[]
** xref:cli/query-syntax.adoc[]
** xref:cli/alternate-installation.adoc[]
* Migrating to Mill
** xref:migrating/maven.adoc[]
// This section gives a tour of the various user-facing features of Mill:
Expand All @@ -56,6 +57,7 @@
** xref:fundamentals/library-deps.adoc[]
** xref:fundamentals/cross-builds.adoc[]
** xref:fundamentals/bundled-libraries.adoc[]
** xref:fundamentals/configuring-jvm-versions.adoc[]
// This section talks about Mill plugins. While it could theoretically fit in
// either section above, it is probably an important enough topic it is worth
// breaking out on its own
Expand Down
120 changes: 0 additions & 120 deletions docs/modules/ROOT/pages/cli/alternate-installation.adoc

This file was deleted.

121 changes: 121 additions & 0 deletions docs/modules/ROOT/pages/cli/installation-ide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -256,3 +256,124 @@ The easiest way to use a development release is to use one of the
`MILL_VERSION` environment variable or a `.mill-version` or `.config/mill-version` file.
== Other installation methods
CAUTION: The installation methods listed below are maintained outside of Mill and may not have
the same features as the xref:cli/installation-ide.adoc#_bootstrap_scripts[bootstrap scripts]. You can try using them,
but the officially supported way to use Mill is via the bootstrap script above, so the Mill
maintainers may be unable to help you if you have issues with some alternate installation method.
CAUTION: Some of the installations via package managers install a fixed version of Mill and
do not support project-specific selection of the preferred Mill version. If you want to use
the `MILL_VERSION` environment variable or need support for `.mill-version` or
`.config/mill-version` files to control the actual used Mill version, please use
a xref:cli/installation-ide.adoc#_bootstrap_scripts[bootstrap script] instead.
=== OS X
Installation via https://github.com/Homebrew/homebrew-core/blob/master/Formula/m/mill.rb[homebrew]:
[source,sh]
----
brew install mill
----
=== Arch Linux
Arch Linux has an https://archlinux.org/packages/extra/any/mill/[Extra package for mill]:
[source,bash]
----
pacman -S mill

----
=== FreeBSD
Installation via http://man.freebsd.org/pkg/8[pkg(8)]:
[source,sh]
----
pkg install mill

----
=== Gentoo Linux
[source,sh]
----
emerge dev-java/mill-bin

----
=== Windows
To get started, download Mill from
{mill-github-url}/releases/download/{mill-last-tag}/{mill-last-tag}-assembly[Github releases], and save it as `mill.bat`.
If you're using https://scoop.sh[Scoop] you can install Mill via
[source,bash]
----
scoop install mill
----
=== WSL / MSYS2 / Cycgin / Git-Bash
Mill also works on "sh" environments on Windows (e.g.,
https://www.msys2.org[MSYS2],
https://www.cygwin.com[Cygwin],
https://gitforwindows.org[Git-Bash],
https://docs.microsoft.com/en-us/windows/wsl[WSL]); to get started, follow the instructions in the <<_manual>>
section. Note that:
* In some environments (such as WSL), Mill might have to be run without a server (using `-i`, `--interactive`, or `--no-server`.)
* On Cygwin, run the following after downloading mill:
[source,bash]
----
sed -i '0,/-cp "\$0"/{s/-cp "\$0"/-cp `cygpath -w "\$0"`/}; 0,/-cp "\$0"/{s/-cp "\$0"/-cp `cygpath -w "\$0"`/}' /usr/local/bin/mill
----
=== Docker
You can download and run
a https://hub.docker.com/r/nightscape/scala-mill/["Docker image containing OpenJDK, Scala and Mill"] using
[source,bash]
----
docker pull nightscape/scala-mill
docker run -it nightscape/scala-mill
----
=== Manual
To get started, download Mill and install it into your HOME ".local/bin" via the following
`curl`/`chmod` command:
[source,bash,subs="verbatim,attributes"]
----
sh -c "curl -L {mill-github-url}/releases/download/{mill-last-tag}/{mill-last-tag} > ~/.local/bin/mill && chmod +x ~/.local/bin/mill"
----
=== Coursier (unsupported)
Installing mill via `coursier` or `cs` is currently not officially supported.
There are various issues, especially with interactive mode.
=== Asdf (unsupported)
You can install and manage Mill via the Multiple Runtime Version Manager - https://asdf-vm.com/[`asdf`].
Support by `asdf` is currently possible by using the https://github.com/asdf-community/asdf-mill[`asdf-mill` plugin]:
.Steps to install the `mill` plugin and Mill with `asdf`
[source,bash]
---
asdf plugin add mill
asdf install mill latest
asdf global mill latest
---
Loading

0 comments on commit 80cf5fb

Please sign in to comment.