Skip to content

Commit 3e32546

Browse files
committed
add build
1 parent 3152d0e commit 3e32546

File tree

6 files changed

+81
-16
lines changed

6 files changed

+81
-16
lines changed

.gitignore

-16
Original file line numberDiff line numberDiff line change
@@ -1,17 +1 @@
1-
/.settings/
2-
/.idea/
31
target/
4-
*.log
5-
*.iml
6-
/\.target/
7-
/\.cache
8-
/\.project
9-
/\.classpath
10-
.history
11-
.DS_Store
12-
/tmp/
13-
/bin/
14-
/.cache-main
15-
/.cache-tests
16-
admin/.coursier
17-
admin/.scalafmt*

build.sbt

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
lazy val root = project.in(file("."))
2+
.settings(ScalaModulePlugin.scalaModuleSettings)
3+
.settings(
4+
name := "scala-library-next",
5+
scalacOptions ++= Seq("-deprecation", "-feature", "-Werror"),
6+
scalaModuleMimaPreviousVersion := None,
7+
libraryDependencies ++= Seq(
8+
"junit" % "junit" % "4.13.1" % Test,
9+
"org.scalacheck" %% "scalacheck" % "1.14.3" % Test,
10+
)
11+
)

build.sh

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Builds of tagged revisions are published to sonatype staging.
6+
7+
# Travis runs a build on new revisions and on new tags, so a tagged revision is built twice.
8+
# Builds for a tag have TRAVIS_TAG defined, which we use for identifying tagged builds.
9+
10+
# sbt-dynver sets the version number from the tag
11+
# sbt-travisci sets the Scala version from the travis job matrix
12+
13+
# To back-publish an existing release for a new Scala / Scala.js / Scala Native version:
14+
# - check out the tag for the version that needs to be published
15+
# - change `.travis.yml` to adjust the version numbers and trim down the build matrix as necessary
16+
# - commit the changes and tag this new revision with an arbitrary suffix after a hash, e.g.,
17+
# `v1.2.3#dotty-0.27` (the suffix is ignored, the version will be `1.2.3`)
18+
19+
isReleaseJob() {
20+
if [[ "$ADOPTOPENJDK" == "8" ]]; then
21+
true
22+
else
23+
false
24+
fi
25+
}
26+
27+
if [[ "$SCALAJS_VERSION" == "" ]]; then
28+
projectPrefix=""
29+
else
30+
projectPrefix="TODO/"
31+
fi
32+
33+
verPat="[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9-]+)?"
34+
tagPat="^v$verPat(#.*)?$"
35+
36+
if [[ "$TRAVIS_TAG" =~ $tagPat ]]; then
37+
releaseTask="ci-release"
38+
if ! isReleaseJob; then
39+
echo "Not releasing on Java $ADOPTOPENJDK with Scala $TRAVIS_SCALA_VERSION"
40+
exit 0
41+
fi
42+
fi
43+
44+
# default is +publishSigned; we cross-build with travis jobs, not sbt's crossScalaVersions
45+
export CI_RELEASE="${projectPrefix}publishSigned"
46+
export CI_SNAPSHOT_RELEASE="${projectPrefix}publish"
47+
48+
# default is sonatypeBundleRelease, which closes and releases the staging repo
49+
# see https://github.com/xerial/sbt-sonatype#commands
50+
# for now, until we're confident in the new release scripts, just close the staging repo.
51+
export CI_SONATYPE_RELEASE="; sonatypePrepare; sonatypeBundleUpload; sonatypeClose"
52+
53+
sbt clean $projectPrefix/test $projectPrefix/publishLocal $releaseTask

project/build.properties

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sbt.version=1.4.1

project/plugins.sbt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "2.2.3")
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* Scala (https://www.scala-lang.org)
3+
*
4+
* Copyright EPFL and Lightbend, Inc.
5+
*
6+
* Licensed under Apache License 2.0
7+
* (http://www.apache.org/licenses/LICENSE-2.0).
8+
*
9+
* See the NOTICE file distributed with this work for
10+
* additional information regarding copyright ownership.
11+
*/
12+
13+
package scala
14+
15+
object SampleAddition

0 commit comments

Comments
 (0)