1- val ScalaNativeVersion = " 0.5.9-SNAPSHOT"
1+ import scala .util .Properties .envOrNone
2+ import scala .scalanative .nir .Proxy .nativeBinaryVersion
3+
4+ val ScalaNativeVersion = envOrNone(" CI_NATIVE_VERSION" )
5+ .filterNot(_.isEmpty)
6+ .getOrElse(" 0.5.8" )
27
38val crossScalaVersions212 = (14 to 20 ).map(" 2.12." + _)
4- val crossScalaVersions213 = (8 to 16 ).map(" 2.13." + _)
9+ val crossScalaVersions213 = (8 to 17 ).map(" 2.13." + _)
510val crossScalaVersions3 =
611 (2 to 3 ).map(" 3.1." + _) ++
712 (0 to 2 ).map(" 3.2." + _) ++
8- (0 to 6 ).map(" 3.3." + _) ++
13+ (0 to 7 ).map(" 3.3." + _) ++
914 (0 to 3 ).map(" 3.4." + _) ++
1015 (0 to 2 ).map(" 3.5." + _) ++
1116 (2 to 4 ).map(" 3.6." + _) ++
12- (0 to 1 ).map(" 3.7." + _) ++
17+ (0 to 3 ).map(" 3.7." + _) ++
1318 Nil
1419
1520val scala2_12 = crossScalaVersions212.last
@@ -100,9 +105,6 @@ inThisBuild(
100105 Some (" scm:git:git@github.com:scala-native/scala-native-cli.git" )
101106 )
102107 ),
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" ),
106108 resolvers += Resolver .sonatypeCentralSnapshots,
107109 resolvers += Resolver .mavenCentral,
108110 resolvers += Resolver .defaultLocal
@@ -120,11 +122,10 @@ lazy val cli = project
120122 crossScalaVersions := publishScalaVersions,
121123 Compile / run / mainClass :=
122124 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- },
125+ scalacOptions ++= Seq (
126+ " -release:8" ,
127+ " -Ywarn-unused:imports"
128+ ),
128129 libraryDependencies ++= Seq (
129130 " org.scala-native" %% " tools" % scalaNativeVersion.value,
130131 " com.github.scopt" %% " scopt" % " 4.0.1" ,
@@ -170,13 +171,6 @@ lazy val cliScriptedTests = project
170171 }
171172 )
172173
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-
180174val nativeSourceExtensions = Set (" .c" , " .cpp" , " .cxx" , " .h" , " .hpp" , " .S" )
181175val DeduplicateOrRename = new sbtassembly.MergeStrategy {
182176 def name : String = " deduplicate-or-rename"
@@ -230,7 +224,7 @@ lazy val cliPackSettings = Def.settings(
230224 val lm = {
231225 import sbt .librarymanagement .ivy ._
232226 val ivyConfig = InlineIvyConfiguration ()
233- .withResolvers(resolvers.value.toVector)
227+ .withResolvers(( ThisBuild / resolvers) .value.toVector)
234228 .withLog(log)
235229 IvyDependencyResolution (ivyConfig)
236230 }
@@ -312,9 +306,7 @@ lazy val sonatypePublishSettings = Def.settings(
312306 publishMavenStyle := true ,
313307 pomIncludeRepository := (_ => false ),
314308 publishTo := {
315- val centralSnapshots =
316- " https://central.sonatype.com/repository/maven-snapshots/"
317- if (isSnapshot.value) Some (" central-snapshots" at centralSnapshots)
309+ if (isSnapshot.value) Some (Resolver .sonatypeCentralSnapshots)
318310 else localStaging.value
319311 },
320312 credentials ++= {
0 commit comments