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

chore: Upgrade build deps to ensure compatible with Scala Native #178

Merged
merged 10 commits into from
Jan 8, 2025
23 changes: 12 additions & 11 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: ['11', '17']
java: ['11', '17', '21']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
Expand All @@ -28,13 +28,13 @@ jobs:
check-binary-compatibility:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 11
java-version: 17
- name: Check Binary Compatibility
run: ./mill -i __.mimaReportBinaryIssues

Expand All @@ -47,12 +47,12 @@ jobs:
SONATYPE_PGP_PRIVATE_KEY_PASSWORD: ${{ secrets.SONATYPE_PGP_PRIVATE_KEY_PASSWORD }}
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
LANG: "en_US.UTF-8"
LC_MESSAGES: "en_US.UTF-8"
LC_ALL: "en_US.UTF-8"
LANG: 'en_US.UTF-8'
LC_MESSAGES: 'en_US.UTF-8'
LC_ALL: 'en_US.UTF-8'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 11
Expand All @@ -73,6 +73,7 @@ jobs:
fi
- name: Create GitHub Release
id: create_gh_release
# WARN: `actions/create-release` is currently unmaintained. It just works now, keep it until it breaks.
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
Expand Down
57 changes: 42 additions & 15 deletions build.mill
Original file line number Diff line number Diff line change
@@ -1,29 +1,56 @@
package build

import mill._
import mill.scalalib._
import mill.scalalib.publish.{Developer, License, PomSettings, VersionControl}
import scalalib._
import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version::0.4.0`
import $ivy.`com.github.lolgab::mill-mima::0.0.23`

import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version::0.4.1`
import $ivy.`com.github.lolgab::mill-mima::0.0.24`

import de.tobiasroeser.mill.vcs.version.VcsVersion
import com.github.lolgab.mill.mima._

val dottyVersion = sys.props.get("dottyVersion")
lqhuang marked this conversation as resolved.
Show resolved Hide resolved
val scalaVersions = List("2.12.20", "2.13.15", "3.3.4") ++ dottyVersion

val scalaVersions = List("2.12.17", "2.13.10", "2.11.12", "3.1.1") ++ dottyVersion

object requests extends Cross[RequestsModule](scalaVersions)
trait RequestsModule extends CrossScalaModule with PublishModule with Mima {
def publishVersion = VcsVersion.vcsState().format()
def mimaPreviousVersions =
(
Seq("0.7.0", "0.7.1", "0.8.2") ++
Option.when(VcsVersion.vcsState().commitsSinceLastTag != 0)(VcsVersion.vcsState().lastTag).flatten
).distinct
trait RequestsJvmModule extends RequestsModule with Mima {
def mimaPreviousArtifacts = Agg(
(
Seq("0.7.0", "0.7.1", "0.8.2")
++ Option
.when(VcsVersion.vcsState().commitsSinceLastTag != 0)(VcsVersion.vcsState().lastTag)
.flatten
).map(v => ivy"com.lihaoyi::requests:${v}") : _*
)
override def mimaBinaryIssueFilters = Seq(
ProblemFilter.exclude[ReversedMissingMethodProblem]("requests.BaseSession.send"),
ProblemFilter.exclude[DirectMissingMethodProblem]("requests.Response.string")
)
}
object requests extends Cross[RequestsJvmModule](scalaVersions) {}

/**
* Placeholder for Scala Native module
*/
// object native extends Cross[RequestsNativeModule](scalaVersions)
// trait RequestsNativeModule extends RequestsModule with ScalaNativeModule {
// override def scalaNativeVersion = scalaNative
// override def nativeEmbedResources = true

// def ivyDeps =
// super.ivyDeps() ++ Agg(ivy"com.github.lolgab::scala-native-crypto::0.1.0")
// def nativeLinkingOptions = Seq("-lmicrohttpd")

// object test extends ScalaNativeTests with RequestsTestModule {
// def nativeLinkingOptions =
// super.nativeLinkingOptions() ++ Seq("-L/usr/local/opt/openssl@3/lib")
// }
// }

trait RequestsModule extends CrossScalaModule
with PlatformScalaModule
with PublishModule {
def publishVersion = VcsVersion.vcsState().format()

def pomSettings = PomSettings(
description = "Scala port of the popular Python Requests HTTP client",
Expand All @@ -32,11 +59,11 @@ trait RequestsModule extends CrossScalaModule with PublishModule with Mima {
licenses = Seq(License.MIT),
versionControl = VersionControl.github("com-lihaoyi", "requests-scala"),
developers = Seq(
Developer("lihaoyi", "Li Haoyi","https://github.com/lihaoyi")
Developer("lihaoyi", "Li Haoyi", "https://github.com/lihaoyi")
)
)

def ivyDeps = Agg(ivy"com.lihaoyi::geny::1.0.0")
def ivyDeps = Agg(ivy"com.lihaoyi::geny::1.1.1")

object test extends ScalaTests with TestModule.Utest {
def ivyDeps = Agg(
Expand Down
Loading