Skip to content

add build #6

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

Merged
merged 1 commit into from
Oct 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1 @@
/.settings/
/.idea/
target/
*.log
*.iml
/\.target/
/\.cache
/\.project
/\.classpath
.history
.DS_Store
/tmp/
/bin/
/.cache-main
/.cache-tests
admin/.coursier
admin/.scalafmt*
11 changes: 11 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
lazy val root = project.in(file("."))
.settings(ScalaModulePlugin.scalaModuleSettings)
.settings(
name := "scala-library-next",
scalacOptions ++= Seq("-deprecation", "-feature", "-Werror"),
scalaModuleMimaPreviousVersion := None,
libraryDependencies ++= Seq(
"junit" % "junit" % "4.13.1" % Test,
"org.scalacheck" %% "scalacheck" % "1.14.3" % Test,
)
)
53 changes: 53 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash

set -e

# Builds of tagged revisions are published to sonatype staging.

# Travis runs a build on new revisions and on new tags, so a tagged revision is built twice.
# Builds for a tag have TRAVIS_TAG defined, which we use for identifying tagged builds.

# sbt-dynver sets the version number from the tag
# sbt-travisci sets the Scala version from the travis job matrix

# To back-publish an existing release for a new Scala / Scala.js / Scala Native version:
# - check out the tag for the version that needs to be published
# - change `.travis.yml` to adjust the version numbers and trim down the build matrix as necessary
# - commit the changes and tag this new revision with an arbitrary suffix after a hash, e.g.,
# `v1.2.3#dotty-0.27` (the suffix is ignored, the version will be `1.2.3`)

isReleaseJob() {
if [[ "$ADOPTOPENJDK" == "8" ]]; then
true
else
false
fi
}

if [[ "$SCALAJS_VERSION" == "" ]]; then
projectPrefix=""
else
projectPrefix="TODO/"
fi

verPat="[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9-]+)?"
tagPat="^v$verPat(#.*)?$"

if [[ "$TRAVIS_TAG" =~ $tagPat ]]; then
releaseTask="ci-release"
if ! isReleaseJob; then
echo "Not releasing on Java $ADOPTOPENJDK with Scala $TRAVIS_SCALA_VERSION"
exit 0
fi
fi

# default is +publishSigned; we cross-build with travis jobs, not sbt's crossScalaVersions
export CI_RELEASE="${projectPrefix}publishSigned"
export CI_SNAPSHOT_RELEASE="${projectPrefix}publish"

# default is sonatypeBundleRelease, which closes and releases the staging repo
# see https://github.com/xerial/sbt-sonatype#commands
# for now, until we're confident in the new release scripts, just close the staging repo.
export CI_SONATYPE_RELEASE="; sonatypePrepare; sonatypeBundleUpload; sonatypeClose"

sbt clean ${projectPrefix}test ${projectPrefix}publishLocal $releaseTask
1 change: 1 addition & 0 deletions project/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version=1.4.1
1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "2.2.3")
15 changes: 15 additions & 0 deletions src/main/scala/scala/SampleAddition.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Scala (https://www.scala-lang.org)
*
* Copyright EPFL and Lightbend, Inc.
*
* Licensed under Apache License 2.0
* (http://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/

package scala

object SampleAddition