Skip to content

Commit cf2a18c

Browse files
committed
Fix CI issues
1 parent d467f23 commit cf2a18c

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ bin/
2727

2828
# vim
2929
*.swp
30+
**/*.DS_Store

build.sbt

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
val ScalaNativeVersion = "0.5.9-SNAPSHOT"
1+
import scala.scalanative.nir.Proxy.nativeBinaryVersion
2+
23

34
val crossScalaVersions212 = (14 to 20).map("2.12." + _)
45
val crossScalaVersions213 = (8 to 16).map("2.13." + _)
@@ -100,9 +101,6 @@ inThisBuild(
100101
Some("scm:git:[email protected]:scala-native/scala-native-cli.git")
101102
)
102103
),
103-
// Used during the releases
104-
resolvers += "Sonatype Central Deployments" at "https://central.sonatype.com/api/v1/publisher/deployments/download/",
105-
resolvers ++= Resolver.sonatypeOssRepos("snapshots"),
106104
resolvers += Resolver.sonatypeCentralSnapshots,
107105
resolvers += Resolver.mavenCentral,
108106
resolvers += Resolver.defaultLocal
@@ -120,11 +118,10 @@ lazy val cli = project
120118
crossScalaVersions := publishScalaVersions,
121119
Compile / run / mainClass :=
122120
Some("scala.scalanative.cli.ScalaNativeLd"),
123-
scalacOptions += "-Ywarn-unused:imports",
124-
scalacOptions ++= CrossVersion.partialVersion(scalaVersion.value).collect {
125-
case (2, _) => "-target:jvm-1.8"
126-
case (3, _) => "-Xtarget:8"
127-
},
121+
scalacOptions ++= Seq(
122+
"-release:8",
123+
"-Ywarn-unused:imports"
124+
),
128125
libraryDependencies ++= Seq(
129126
"org.scala-native" %% "tools" % scalaNativeVersion.value,
130127
"com.github.scopt" %% "scopt" % "4.0.1",
@@ -170,13 +167,6 @@ lazy val cliScriptedTests = project
170167
}
171168
)
172169

173-
def nativeBinaryVersion(version: String): String = {
174-
val VersionPattern = raw"(\d+)\.(\d+)\.(\d+)(\-.*)?".r
175-
val VersionPattern(major, minor, patch, milestone) = version
176-
if (patch != null && milestone != null) version
177-
else s"$major.$minor"
178-
}
179-
180170
val nativeSourceExtensions = Set(".c", ".cpp", ".cxx", ".h", ".hpp", ".S")
181171
val DeduplicateOrRename = new sbtassembly.MergeStrategy {
182172
def name: String = "deduplicate-or-rename"
@@ -230,7 +220,7 @@ lazy val cliPackSettings = Def.settings(
230220
val lm = {
231221
import sbt.librarymanagement.ivy._
232222
val ivyConfig = InlineIvyConfiguration()
233-
.withResolvers(resolvers.value.toVector)
223+
.withResolvers((ThisBuild / resolvers).value.toVector)
234224
.withLog(log)
235225
IvyDependencyResolution(ivyConfig)
236226
}
@@ -312,9 +302,7 @@ lazy val sonatypePublishSettings = Def.settings(
312302
publishMavenStyle := true,
313303
pomIncludeRepository := (_ => false),
314304
publishTo := {
315-
val centralSnapshots =
316-
"https://central.sonatype.com/repository/maven-snapshots/"
317-
if (isSnapshot.value) Some("central-snapshots" at centralSnapshots)
305+
if (isSnapshot.value) Some(Resolver.sonatypeCentralSnapshots)
318306
else localStaging.value
319307
},
320308
credentials ++= {

project/Internals.scala

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package scala.scalanative
2+
3+
// Proxy to package private methods
4+
package nir {
5+
object Proxy {
6+
def nativeBinaryVersion(version: String) = Versions.binaryVersion(version)
7+
}
8+
}

project/plugins.sbt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.0.0")
22
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")
33
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.0")
4+
5+
// Used only to access cross-version utilities
6+
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.8")

0 commit comments

Comments
 (0)