diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml new file mode 100644 index 00000000000..88f541f1fe0 --- /dev/null +++ b/.github/workflows/build-test.yml @@ -0,0 +1,171 @@ +name: Check + +on: + pull_request: # Check Pull Requests + + push: + branches: + - 2.8.x # Check 2.8.x branch after merge + + schedule: + - cron: "0 3 * * *" # Nightly build (@daily) + +concurrency: + # Only run once for latest commit per ref and cancel other (previous) runs. + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + extra-vars: + name: Extra variables + runs-on: ubuntu-20.04 + outputs: + akka_version_opts: ${{ steps.akka-snapshots.outputs.akka_opts }} + akka_http_version_opts: ${{ steps.akka-snapshots.outputs.akka_http_opts }} + steps: + - id: akka-snapshots + run: | + if [ "$GITHUB_EVENT_NAME" = "schedule" ]; then + AKKA_VERSION=$(curl -s https://oss.sonatype.org/content/repositories/snapshots/com/typesafe/akka/akka-actor_2.13/ | grep -oEi '2\.6\.[0-9]+\+[RCM0-9]+-[0-9a-f]{8}-SNAPSHOT' | sort -V | tail -n 1) + AKKA_HTTP_VERSION=$(curl -s https://oss.sonatype.org/content/repositories/snapshots/com/typesafe/akka/akka-http-core_2.13/ | grep -oEi '10\.1\.[0-9]+\+[RCM0-9]+-[0-9a-f]{8}-SNAPSHOT' | sort -V | tail -n 1) + echo "::set-output name=akka_opts::-Dakka.version=$AKKA_VERSION" + echo "::set-output name=akka_http_opts::-Dakka.http.version=$AKKA_HTTP_VERSION" + else + echo "::set-output name=akka_opts::" + echo "::set-output name=akka_http_opts::" + fi + + prefetch-for-caching: + name: Prefetch dependencies and JVMs for caching + uses: playframework/.github/.github/workflows/cmd.yml@v2 + with: + cmd: | + if [ "$CACHE_HIT_COURSIER" = "false" ]; then + sbt +update # Runs with adoptium:8 (default) + # sbt --sbt-version 1.6.2 +update # If we run scripted tests with multiple sbt versions, we could init that sbt installs here + sbt +mimaPreviousClassfiles # Fetches previous artifacts + cd documentation && sbt +update && cd .. # Fetches dependencies of the documentation project + sbt -java-home `cs java-home --jvm adoptium:11` exit # Init sbt with new JVM that will be downloaded + sbt -java-home `cs java-home --jvm adoptium:17` exit # Init sbt with new JVM that will be downloaded + fi + + check-code-style: + name: Code Style # scalafmt, javafmt, file headers, akka version check + needs: + - "extra-vars" + - "prefetch-for-caching" + uses: playframework/.github/.github/workflows/cmd.yml@v2 + with: + cmd: sbt "${{needs.extra-vars.outputs.akka_version_opts}}" "${{needs.extra-vars.outputs.akka_http_version_opts}}" validateCode + + check-binary-compatibility: + name: Binary Compatibility + needs: "prefetch-for-caching" + uses: playframework/.github/.github/workflows/binary-check.yml@v1 + + check-code-style-docs: + name: Code Style Docs + needs: "prefetch-for-caching" + uses: playframework/.github/.github/workflows/cmd.yml@v2 + with: + cmd: | + cd documentation + sbt validateCode + + publish-local: + name: Publish Local + needs: + - "extra-vars" + - "check-code-style" + - "check-binary-compatibility" + - "check-code-style-docs" + uses: playframework/.github/.github/workflows/cmd.yml@v2 + with: + java: 11, 8 + cmd: | + rm -rf ~/.ivy2/local + sbt "${{needs.extra-vars.outputs.akka_version_opts}}" "${{needs.extra-vars.outputs.akka_http_version_opts}}" crossScalaVersions crossSbtVersions +publishLocal + cache-path: ~/.ivy2/local/com.typesafe.play + cache-key: play-published-local-jdk{0}-${{ github.sha }}-${{ github.event_name != 'schedule' || github.run_id }} + + tests: + name: Tests + needs: + - "extra-vars" + - "check-code-style" + - "check-binary-compatibility" + - "check-code-style-docs" + uses: playframework/.github/.github/workflows/cmd.yml@v2 + with: + java: 11, 8 + scala: 2.12.15, 2.13.8 + add-dimensions: >- + { + "sbt_test_task": [ "test", "Play-Integration-Test/It/test", "Play-Microbenchmark/jmh:run -i 1 -wi 0 -f 1 -t 1 -foe=true" ] + } + exclude: >- + [ + { "java": "${{ github.event_name == 'schedule' || '11' }}" }, + { "scala": "${{ github.event_name == 'schedule' || '2.12.15' }}" }, + { "sbt_test_task": "${{ github.event_name == 'schedule' || 'Play-Microbenchmark/jmh:run -i 1 -wi 0 -f 1 -t 1 -foe=true' }}" } + ] + cmd: sbt "${{needs.extra-vars.outputs.akka_version_opts}}" "${{needs.extra-vars.outputs.akka_http_version_opts}}" ++$MATRIX_SCALA "$MATRIX_SBT_TEST_TASK" + + docs-tests: + name: Docs Tests + needs: + - "extra-vars" + - "check-code-style" + - "check-binary-compatibility" + - "check-code-style-docs" + uses: playframework/.github/.github/workflows/cmd.yml@v2 + with: + java: 11, 8 + scala: 2.12.15, 2.13.8 + exclude: >- + [ + { "java": "${{ github.event_name == 'schedule' || '11' }}" }, + { "scala": "${{ github.event_name == 'schedule' || '2.12.15' }}" } + ] + cmd: cd documentation && sbt "${{needs.extra-vars.outputs.akka_version_opts}}" "${{needs.extra-vars.outputs.akka_http_version_opts}}" ++$MATRIX_SCALA test + + scripted-tests: + name: Scripted Tests + needs: + - "extra-vars" + - "publish-local" + uses: playframework/.github/.github/workflows/cmd.yml@v2 + with: + java: 11, 8 + scala: 2.12.15, 2.13.8 + add-dimensions: >- + { + "sbt": [ "1.3.13", "1.6.2" ], + "sbt_steps": [ "*1of3", "*2of3", "*3of3" ] + } + exclude: >- + [ + { "java": "${{ github.event_name == 'schedule' || '11' }}" }, + { "scala": "${{ github.event_name == 'schedule' || '2.12.15' }}" }, + { "sbt": "${{ github.event_name == 'schedule' || '1.3.13' }}" } + ] + cmd: >- + sbt "${{needs.extra-vars.outputs.akka_version_opts}}" "${{needs.extra-vars.outputs.akka_http_version_opts}}" " + project Sbt-Plugin; + set scriptedSbt := \"$MATRIX_SBT\"; + set scriptedLaunchOpts += \"-Dscala.version=$MATRIX_SCALA\"; + show scriptedSbt; + show scriptedLaunchOpts; + scripted play-sbt-plugin/$MATRIX_SBT_STEPS + " + cache-path: ~/.ivy2/local/com.typesafe.play + cache-key: play-published-local-jdk{0}-${{ github.sha }}-${{ github.event_name != 'schedule' || github.run_id }} + + finish: + name: Finish + if: github.event_name == 'pull_request' + needs: # Should be last + - "tests" + - "docs-tests" + - "scripted-tests" + uses: playframework/.github/.github/workflows/rtm.yml@v1 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000000..bd6cfe9e7e5 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,17 @@ +name: Publish + +on: + push: + branches: # Snapshots + - 2.8.x + tags: ["*"] # Releases + +jobs: + publish-artifacts: + name: Publish / Artifacts + uses: playframework/.github/.github/workflows/publish.yml@v1 + secrets: + username: ${{ secrets.SONATYPE_USERNAME }} + password: ${{ secrets.SONATYPE_PASSWORD }} + pgp_passphrase: ${{ secrets.PGP_PASSPHRASE }} + pgp_secret: ${{ secrets.PGP_SECRET }} diff --git a/.gitignore b/.gitignore index ffebb8d8a10..30bf8de43cf 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,6 @@ RUNNING_PID generated.keystore generated.truststore *.log -!.travis-jvmopts # Build Server Protocol .bsp/ diff --git a/.mergify.yml b/.mergify.yml deleted file mode 100644 index 67387409381..00000000000 --- a/.mergify.yml +++ /dev/null @@ -1,70 +0,0 @@ -pull_request_rules: - - name: Merge PRs that are ready - conditions: - - status-success=Travis CI - Pull Request - - status-success=typesafe-cla-validator - - "#approved-reviews-by>=1" - - "#review-requested=0" - - "#changes-requested-reviews-by=0" - - label!=status:block-merge - actions: - merge: - method: merge - - - name: backport patches to 2.7.x branch - conditions: - - merged - - label=status:needs-backport - actions: - backport: - branches: - - 2.7.x - label: - remove: [status:needs-backport] - - - name: backport patches to 2.6.x branch - conditions: - - merged - - label=status:needs-backport-2.6 - actions: - backport: - branches: - - 2.6.x - label: - remove: [status:needs-backport-2.6] - - - name: forward patches to main branch - conditions: - - merged - - label=status:needs-forwardport - actions: - backport: - branches: - - main - label: - remove: [status:needs-forwardport] - - - name: Merge ScalaSteward's PRs that are ready - conditions: - - author=scala-steward - - status-success=Travis CI - Pull Request - - "#review-requested=0" - - "#changes-requested-reviews-by=0" - - label!=status:block-merge - actions: - merge: - method: merge - - - name: Delete the PR branch after merge - conditions: - - merged - actions: - delete_head_branch: {} - - - name: auto add wip - conditions: - # match a few flavours of wip - - title~=^(\[wip\]( |:) |\[WIP\]( |:) |wip( |:) |WIP( |:)).* - actions: - label: - add: ["status:block-merge"] diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 491c806029e..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,140 +0,0 @@ -language: scala - -# Only build non-pushes (so PRs, API requests & cron jobs) OR tags OR forks OR main branch builds -# https://docs.travis-ci.com/user/conditional-builds-stages-jobs/ -if: type != push OR tag IS present OR repo != playframework/playframework OR branch IN (main, 2.7.x, 2.6.x) - -git: - depth: false # Avoid sbt-dynver not seeing the tag - -env: - global: - - secure: "NS2hMbBcmi6EF4QxtcNs4A2ZuNmIdLYQRJUWWejgnD4YtcsmoVjxrHRedqrnDdui4DyvaxWhg/3Uds23jEKTSbbh3ZphLO77BVgM2nUGUvVoa4i6qGF2eZFlIhq2G1gM700GPV7X4KmyjYi2HtH8CWBTkqP3g0An63mCZw/Gnlk=" - # These are the versions used for (scripted) tests. The versions Play is build with however are defined in interplay. - - SCRIPTED_SBT_1_3: "1.3.13" - - SCRIPTED_SBT_1_6: "1.6.2" - - TEST_SCALA_2_12: "2.12.15" - - TEST_SCALA_2_13: "2.13.8" - jobs: - - TRAVIS_JDK=8 - -before_install: - - curl --version # for debug purpose - - if [ ! -f ~/.jabba/jabba.sh ]; then curl -L -v --retry 5 -o jabba-install.sh https://git.io/jabba && bash jabba-install.sh; fi - - . ~/.jabba/jabba.sh -install: jabba install $(jabba ls-remote "adopt@~1.$TRAVIS_JDK.0-0" --latest=patch) && jabba use "$_" && java -Xmx32m -version - -stages: - - validations - - test - - test-sbt-1.3.x - - cron-test-sbt-1.3.x - - cron-test-sbt-1.6.x - - java11 - -jobs: - include: - - stage: validations - name: "Run publishLocal" - script: scripts/publish-local - workspaces: - create: - name: published-local - paths: "$HOME/.ivy2/local/com.typesafe.play" - - name: "Run publishLocal on Java 11" - script: scripts/publish-local - env: TRAVIS_JDK=11 - workspaces: - create: - name: published-local-jdk11 - paths: "$HOME/.ivy2/local/com.typesafe.play" - - script: scripts/validate-code - name: "Code validations (format, binary compatibility, etc.)" - - script: scripts/validate-docs - name: "Validate docs (links, sample code, etc.)" - - script: scripts/validate-microbenchmarks - name: "Validate that microbenchmarks are runnable" - - - - stage: test - script: scripts/it-test $TEST_SCALA_2_13 - name: "Run it tests for Scala 2.13" - - script: scripts/it-test $TEST_SCALA_2_12 - name: "Run it tests for Scala 2.12" - - script: scripts/test $TEST_SCALA_2_13 - name: "Run tests for Scala 2.13" - - script: scripts/test $TEST_SCALA_2_12 - name: "Run tests for Scala 2.12" - - script: scripts/test-docs $TEST_SCALA_2_13 - name: "Run documentation tests 2.13" - - script: scripts/test-docs $TEST_SCALA_2_12 - name: "Run documentation tests 2.12" - - - stage: test-sbt-1.3.x - name: "Run scripted tests (a) for sbt 1.3.x and Scala 2.12.x" - script: scripts/test-scripted $SCRIPTED_SBT_1_3 $TEST_SCALA_2_12 'play-sbt-plugin/*1of3' - workspaces: - use: published-local - - name: "Run scripted tests (b) for sbt 1.3.x and Scala 2.12.x" - script: scripts/test-scripted $SCRIPTED_SBT_1_3 $TEST_SCALA_2_12 'play-sbt-plugin/*2of3' - workspaces: - use: published-local - - name: "Run scripted tests (c) for sbt 1.3.x and Scala 2.12.x" - script: scripts/test-scripted $SCRIPTED_SBT_1_3 $TEST_SCALA_2_12 'play-sbt-plugin/*3of3' - workspaces: - use: published-local - - # Test against Java 11, but only for Scala 2.12 - - stage: java11 - script: scripts/test $TEST_SCALA_2_12 - env: TRAVIS_JDK=11 - name: "Run tests for Scala 2.12 and Java 11" - - script: scripts/it-test $TEST_SCALA_2_12 - env: TRAVIS_JDK=11 - name: "Run it tests for Scala 2.12 and Java 11" - - script: scripts/test-docs $TEST_SCALA_2_12 - env: TRAVIS_JDK=11 - name: "Run documentation tests for Scala 2.12 and Java 11" - - name: "Run scripted tests (a) for sbt 1.3.x and Scala 2.12.x and Java 11" - script: scripts/test-scripted $SCRIPTED_SBT_1_3 $TEST_SCALA_2_12 'play-sbt-plugin/*1of3' - env: TRAVIS_JDK=11 - workspaces: - use: published-local-jdk11 - - name: "Run scripted tests (b) for sbt 1.3.x and Scala 2.12.x and Java 11" - script: scripts/test-scripted $SCRIPTED_SBT_1_3 $TEST_SCALA_2_12 'play-sbt-plugin/*2of3' - env: TRAVIS_JDK=11 - workspaces: - use: published-local-jdk11 - - name: "Run scripted tests (c) for sbt 1.3.x and Scala 2.12.x and Java 11" - script: scripts/test-scripted $SCRIPTED_SBT_1_3 $TEST_SCALA_2_12 'play-sbt-plugin/*3of3' - env: TRAVIS_JDK=11 - workspaces: - use: published-local-jdk11 - - # Test against sbt 1.3.x and Scala 2.13.x, but only for cron builds - # (sbt 1.3.x / Scala 2.12.x was tested above already) - - stage: cron-test-sbt-1.3.x - name: "Run tests for sbt 1.3.x and Scala 2.13.x" - script: scripts/test-scripted $SCRIPTED_SBT_1_3 $TEST_SCALA_2_13 - if: type = cron - workspaces: - use: published-local - # Test against sbt 1.6.x, but only for cron builds - - stage: cron-test-sbt-1.6.x - name: "Run tests for 1.6.x and Scala 2.13.x" - script: scripts/test-scripted $SCRIPTED_SBT_1_6 $TEST_SCALA_2_13 - if: type = cron - workspaces: - use: published-local - -cache: - directories: - - "$HOME/.cache/coursier" - - "$HOME/.ivy2/cache" - - "$HOME/.jabba" - - "$HOME/.sbt" - -before_cache: - - rm -rf $HOME/.ivy2/cache/scala_*/sbt_*/com.typesafe.play/* - - find $HOME/.ivy2 -name "ivydata-*.properties" -delete - - find $HOME/.sbt -name "*.lock" -delete diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cd65f67051c..81bd3ca00d3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -36,7 +36,7 @@ Before making a contribution, it is important to make sure that the change you w - Code must conform to standard style guidelines and pass all tests (see [Run tests](https://www.playframework.com/documentation/latest/BuildingFromSource#run-tests)) 6. Basic local validation: - Not use `@author` tags since it does not encourage [Collective Code Ownership](https://www.extremeprogramming.org/rules/collective.html). - - Run `scripts/local-pr-validation.sh` to ensure all files are formatted and have the copyright header. + - Run `sbt validateCode` to ensure all files are formatted and have the copyright header. If you changed docs please run that command inside the `documentation` folder as well. 3. Ensure that your commits are squashed. See [working with git](https://playframework.com/documentation/latest/WorkingWithGit) for more information. 4. Submit a pull request. diff --git a/README.md b/README.md index 358ac7b9b31..0f688fd089b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ # Play Framework - The High Velocity Web Framework -[![Gitter](https://img.shields.io/gitter/room/gitterHQ/gitter.svg)](https://gitter.im/playframework/playframework?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [](https://travis-ci.org/playframework/playframework) [![Maven](https://img.shields.io/maven-central/v/com.typesafe.play/play_2.13.svg)](http://mvnrepository.com/artifact/com.typesafe.play/play_2.13) +[![Discord](https://img.shields.io/discord/931647755942776882)](https://discord.com/channels/931647755942776882) +[![Build Status](https://github.com/playframework/playframework/actions/workflows/build-test.yml/badge.svg)](https://github.com/playframework/playframework/actions/workflows/build-test.yml) +[![Maven](https://img.shields.io/maven-central/v/com.typesafe.play/play_2.13.svg)](https://mvnrepository.com/artifact/com.typesafe.play/play_2.13) +[![OpenCollective](https://opencollective.com/playframework/tiers/badge.svg)](https://opencollective.com/playframework) The Play Framework combines productivity and performance making it easy to build scalable web applications with Java and Scala. Play is developer friendly with a "just hit refresh" workflow and built-in testing support. With Play, applications scale predictably due to a stateless and non-blocking architecture. By being RESTful by default, including assets compilers, JSON & WebSocket support, Play is a perfect fit for modern web & mobile applications. diff --git a/build.sbt b/build.sbt index 2ecd5577195..731fa0a18cf 100644 --- a/build.sbt +++ b/build.sbt @@ -514,3 +514,13 @@ lazy val PlayFramework = Project("Play-Framework", file(".")) Release.settings ) .aggregate((userProjects ++ nonUserProjects): _*) + +addCommandAlias( + "validateCode", + List( + "headerCheckAll", + "scalafmtSbtCheck", + "scalafmtCheckAll", + "javafmtCheckAll", + ).mkString(";") +) diff --git a/cache/play-cache/src/test/resources/logback-test.xml b/cache/play-cache/src/test/resources/logback-test.xml index 36d5a155617..eaf9e018b62 100644 --- a/cache/play-cache/src/test/resources/logback-test.xml +++ b/cache/play-cache/src/test/resources/logback-test.xml @@ -8,7 +8,7 @@ - + %level %logger{15} - %message%n%ex{short} diff --git a/cache/play-caffeine-cache/src/test/resources/logback-test.xml b/cache/play-caffeine-cache/src/test/resources/logback-test.xml index 36d5a155617..eaf9e018b62 100644 --- a/cache/play-caffeine-cache/src/test/resources/logback-test.xml +++ b/cache/play-caffeine-cache/src/test/resources/logback-test.xml @@ -8,7 +8,7 @@ - + %level %logger{15} - %message%n%ex{short} diff --git a/cache/play-ehcache/src/test/resources/logback-test.xml b/cache/play-ehcache/src/test/resources/logback-test.xml index 36d5a155617..eaf9e018b62 100644 --- a/cache/play-ehcache/src/test/resources/logback-test.xml +++ b/cache/play-ehcache/src/test/resources/logback-test.xml @@ -8,7 +8,7 @@ - + %level %logger{15} - %message%n%ex{short} diff --git a/core/play-guice/src/test/resources/logback-test.xml b/core/play-guice/src/test/resources/logback-test.xml index 6fbb82010be..d57ba2b2cbc 100644 --- a/core/play-guice/src/test/resources/logback-test.xml +++ b/core/play-guice/src/test/resources/logback-test.xml @@ -8,7 +8,7 @@ - + %level %logger{15} - %message%n%ex{short} diff --git a/core/play-integration-test/src/it/resources/logback.xml b/core/play-integration-test/src/it/resources/logback.xml index 0202614f3c8..0e24b745550 100644 --- a/core/play-integration-test/src/it/resources/logback.xml +++ b/core/play-integration-test/src/it/resources/logback.xml @@ -8,7 +8,7 @@ - + %level %logger{15} - %message%n%ex{short} diff --git a/core/play-integration-test/src/it/scala/play/it/ServerIntegrationSpecification.scala b/core/play-integration-test/src/it/scala/play/it/ServerIntegrationSpecification.scala index c59e8e89261..c10a56537ac 100644 --- a/core/play-integration-test/src/it/scala/play/it/ServerIntegrationSpecification.scala +++ b/core/play-integration-test/src/it/scala/play/it/ServerIntegrationSpecification.scala @@ -29,6 +29,11 @@ trait ServerIntegrationSpecification extends PendingUntilFixed with AroundEach { parent => implicit def integrationServerProvider: ServerProvider + val isGHA: Boolean = sys.env.get("GITHUB_ACTIONS").exists(_.toBoolean) + val isGHACron: Boolean = sys.env.get("GITHUB_EVENT_NAME").exists(_.equalsIgnoreCase("schedule")) + val isContinuousIntegration: Boolean = isGHA + val isCronBuild: Boolean = isGHACron + def aroundEventually[R: AsResult](r: => R) = { EventuallyResults.eventually[R](1, 20.milliseconds)(r) } @@ -62,18 +67,12 @@ trait ServerIntegrationSpecification extends PendingUntilFixed with AroundEach { } implicit class UntilFastCIServer[T: AsResult](t: => T) { - def skipOnSlowCIServer: Result = parent match { - case _ if isContinuousIntegrationEnvironment => Skipped() - case _ => ResultExecution.execute(AsResult(t)) + def skipOnSlowCIServer: Result = { + if (isContinuousIntegration) Skipped() + else ResultExecution.execute(AsResult(t)) } } - // There are some tests that we still want to run, but Travis CI will fail - // because the server is underpowered... - def isContinuousIntegrationEnvironment: Boolean = { - System.getenv("CONTINUOUS_INTEGRATION") == "true" - } - /** * Override the standard TestServer factory method. */ diff --git a/core/play-integration-test/src/it/scala/play/it/http/websocket/WebSocketSpec.scala b/core/play-integration-test/src/it/scala/play/it/http/websocket/WebSocketSpec.scala index ba5e8f4ec7e..60358ea7b3a 100644 --- a/core/play-integration-test/src/it/scala/play/it/http/websocket/WebSocketSpec.scala +++ b/core/play-integration-test/src/it/scala/play/it/http/websocket/WebSocketSpec.scala @@ -378,7 +378,7 @@ trait WebSocketSpec } trait WebSocketSpecMethods extends PlaySpecification with WsTestClient with ServerIntegrationSpecification { - // Extend the default spec timeout for Travis CI. + // Extend the default spec timeout for CI. implicit override def defaultAwaitTimeout = 10.seconds def withServer[A](webSocket: Application => Handler)(block: Application => A): A = { diff --git a/core/play-java/src/test/resources/logback-test.xml b/core/play-java/src/test/resources/logback-test.xml index 36d5a155617..eaf9e018b62 100644 --- a/core/play-java/src/test/resources/logback-test.xml +++ b/core/play-java/src/test/resources/logback-test.xml @@ -8,7 +8,7 @@ - + %level %logger{15} - %message%n%ex{short} diff --git a/core/play-streams/src/test/resources/logback-test.xml b/core/play-streams/src/test/resources/logback-test.xml index 36d5a155617..eaf9e018b62 100644 --- a/core/play-streams/src/test/resources/logback-test.xml +++ b/core/play-streams/src/test/resources/logback-test.xml @@ -8,7 +8,7 @@ - + %level %logger{15} - %message%n%ex{short} diff --git a/core/play/src/test/resources/logback-test.xml b/core/play/src/test/resources/logback-test.xml index 36d5a155617..eaf9e018b62 100644 --- a/core/play/src/test/resources/logback-test.xml +++ b/core/play/src/test/resources/logback-test.xml @@ -8,7 +8,7 @@ - + %level %logger{15} - %message%n%ex{short} diff --git a/dev-mode/routes-compiler/src/test/resources/logback-test.xml b/dev-mode/routes-compiler/src/test/resources/logback-test.xml index 36d5a155617..eaf9e018b62 100644 --- a/dev-mode/routes-compiler/src/test/resources/logback-test.xml +++ b/dev-mode/routes-compiler/src/test/resources/logback-test.xml @@ -8,7 +8,7 @@ - + %level %logger{15} - %message%n%ex{short} diff --git a/dev-mode/run-support/src/test/resources/logback-test.xml b/dev-mode/run-support/src/test/resources/logback-test.xml index 36d5a155617..eaf9e018b62 100644 --- a/dev-mode/run-support/src/test/resources/logback-test.xml +++ b/dev-mode/run-support/src/test/resources/logback-test.xml @@ -8,7 +8,7 @@ - + %level %logger{15} - %message%n%ex{short} diff --git a/dev-mode/sbt-plugin/src/test/resources/logback-test.xml b/dev-mode/sbt-plugin/src/test/resources/logback-test.xml index 36d5a155617..eaf9e018b62 100644 --- a/dev-mode/sbt-plugin/src/test/resources/logback-test.xml +++ b/dev-mode/sbt-plugin/src/test/resources/logback-test.xml @@ -8,7 +8,7 @@ - + %level %logger{15} - %message%n%ex{short} diff --git a/dev-mode/sbt-scripted-tools/src/main/scala/play/sbt/scriptedtools/ScriptedTools.scala b/dev-mode/sbt-scripted-tools/src/main/scala/play/sbt/scriptedtools/ScriptedTools.scala index c5d6f6e7520..1af653eaf16 100644 --- a/dev-mode/sbt-scripted-tools/src/main/scala/play/sbt/scriptedtools/ScriptedTools.scala +++ b/dev-mode/sbt-scripted-tools/src/main/scala/play/sbt/scriptedtools/ScriptedTools.scala @@ -40,11 +40,11 @@ object ScriptedTools extends AutoPlugin with ScriptedTools0 { .at("https://oss.sonatype.org/service/local/repositories/releases/content/"), // sync ScriptedTools.scala // This is copy/pasted from AkkaSnapshotRepositories since scripted tests also need // the snapshot resolvers in `cron` builds. - // If this is a cron job in Travis: - // https://docs.travis-ci.com/user/cron-jobs/#detecting-builds-triggered-by-cron + // If this is a scheduled GitHub Action + // https://docs.github.com/en/actions/learn-github-actions/environment-variables resolvers ++= sys.env - .get("TRAVIS_EVENT_TYPE") - .filter(_.equalsIgnoreCase("cron")) + .get("GITHUB_EVENT_NAME") + .filter(_.equalsIgnoreCase("schedule")) .map(_ => Resolver.sonatypeRepo("snapshots")) // contains akka(-http) snapshots .toSeq ) diff --git a/documentation/addMarkdownCopyright b/documentation/addMarkdownCopyright deleted file mode 100755 index c34c83590d8..00000000000 --- a/documentation/addMarkdownCopyright +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (C) Lightbend Inc. - - -cd manual -for f in `find . -name '*.md'` -do - echo "" > /tmp/mdcw - if head -n 1 $f | grep -qiE "(Lightbend|Typesafe) Inc. > /tmp/mdcw - else - cat $f >> /tmp/mdcw - fi - cp /tmp/mdcw $f - rm /tmp/mdcw - echo Updated $f -done diff --git a/documentation/build.sbt b/documentation/build.sbt index de80bdcad19..2c447007dcf 100644 --- a/documentation/build.sbt +++ b/documentation/build.sbt @@ -11,6 +11,8 @@ import playbuild.CrossJava import de.heikoseeberger.sbtheader.FileType import de.heikoseeberger.sbtheader.CommentStyle +import de.heikoseeberger.sbtheader.HeaderPlugin.autoImport.HeaderPattern.commentBetween +import de.heikoseeberger.sbtheader.LineCommentCreator val DocsApplication = config("docs").hide @@ -83,8 +85,9 @@ lazy val main = Project("Play-Documentation", file(".")) javaOptions in Test ++= Seq("-Xmx512m", "-Xms128m"), headerLicense := Some(HeaderLicense.Custom("Copyright (C) Lightbend Inc. ")), headerMappings ++= Map( - FileType.xml -> CommentStyle.xmlStyleBlockComment, - FileType.conf -> CommentStyle.hashLineComment + FileType.xml -> CommentStyle.xmlStyleBlockComment, + FileType.conf -> CommentStyle.hashLineComment, + FileType("md") -> CommentStyle(new LineCommentCreator(""), commentBetween("")) ), sourceDirectories in javafmt in Test ++= (unmanagedSourceDirectories in Test).value, sourceDirectories in javafmt in Test ++= (unmanagedResourceDirectories in Test).value, @@ -118,3 +121,16 @@ lazy val main = Project("Play-Documentation", file(".")) lazy val playDocs = playProject("Play-Docs") def playProject(name: String) = ProjectRef(Path.fileProperty("user.dir").getParentFile, name) + +addCommandAlias( + "validateCode", + List( + "evaluateSbtFiles", + "clearCaches", + "validateDocs", + "headerCheckAll", + "scalafmtSbtCheck", + "scalafmtCheckAll", + "javafmtCheckAll", + ).mkString(";") +) diff --git a/documentation/project/plugins.sbt b/documentation/project/plugins.sbt index 75409e6c4cb..730bdbedbba 100644 --- a/documentation/project/plugins.sbt +++ b/documentation/project/plugins.sbt @@ -14,7 +14,7 @@ addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.5") addSbtPlugin("com.typesafe.sbt" % "sbt-play-enhancer" % "1.2.2") // Add headers to example sources -addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.2.0") +addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.7.0") addSbtPlugin("com.lightbend.sbt" % "sbt-java-formatter" % "0.5.1") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.0.7") diff --git a/persistence/play-java-jdbc/src/test/resources/logback-test.xml b/persistence/play-java-jdbc/src/test/resources/logback-test.xml index 36d5a155617..eaf9e018b62 100644 --- a/persistence/play-java-jdbc/src/test/resources/logback-test.xml +++ b/persistence/play-java-jdbc/src/test/resources/logback-test.xml @@ -8,7 +8,7 @@ - + %level %logger{15} - %message%n%ex{short} diff --git a/persistence/play-java-jpa/src/test/resources/logback-test.xml b/persistence/play-java-jpa/src/test/resources/logback-test.xml index 36d5a155617..eaf9e018b62 100644 --- a/persistence/play-java-jpa/src/test/resources/logback-test.xml +++ b/persistence/play-java-jpa/src/test/resources/logback-test.xml @@ -8,7 +8,7 @@ - + %level %logger{15} - %message%n%ex{short} diff --git a/persistence/play-jdbc-evolutions/src/test/resources/logback-test.xml b/persistence/play-jdbc-evolutions/src/test/resources/logback-test.xml index 36d5a155617..eaf9e018b62 100644 --- a/persistence/play-jdbc-evolutions/src/test/resources/logback-test.xml +++ b/persistence/play-jdbc-evolutions/src/test/resources/logback-test.xml @@ -8,7 +8,7 @@ - + %level %logger{15} - %message%n%ex{short} diff --git a/persistence/play-jdbc/src/test/resources/logback-test.xml b/persistence/play-jdbc/src/test/resources/logback-test.xml index c7e770085c0..293e502a029 100644 --- a/persistence/play-jdbc/src/test/resources/logback-test.xml +++ b/persistence/play-jdbc/src/test/resources/logback-test.xml @@ -8,7 +8,7 @@ - + %level %logger{15} - %message%n%ex{short} diff --git a/project/AkkaSnapshotRepositories.scala b/project/AkkaSnapshotRepositories.scala index cb78f5f9d73..f37c243c0ad 100644 --- a/project/AkkaSnapshotRepositories.scala +++ b/project/AkkaSnapshotRepositories.scala @@ -9,11 +9,11 @@ object AkkaSnapshotRepositories extends AutoPlugin { // This is also copy/pasted in ScriptedTools for scripted tests to also use the snapshot repositories. override def projectSettings: Seq[Def.Setting[_]] = { - // If this is a cron job in Travis: - // https://docs.travis-ci.com/user/cron-jobs/#detecting-builds-triggered-by-cron + // If this is a scheduled GitHub Action + // https://docs.github.com/en/actions/learn-github-actions/environment-variables resolvers ++= sys.env - .get("TRAVIS_EVENT_TYPE") - .filter(_.equalsIgnoreCase("cron")) + .get("GITHUB_EVENT_NAME") + .filter(_.equalsIgnoreCase("schedule")) .map(_ => Resolver.sonatypeRepo("snapshots")) // contains akka(-http) snapshots .toSeq } diff --git a/project/plugins.sbt b/project/plugins.sbt index 90b3f8488e3..9d1ec1fcdff 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -10,7 +10,7 @@ val sbtJavaAgent = "0.1.5" val sbtJavaFormatter = "0.5.0" val sbtJmh = "0.3.7" val webjarsLocatorCore = "0.43" -val sbtHeader = "5.2.0" +val sbtHeader = "5.7.0" val scalafmt = "2.0.1" val sbtTwirl: String = sys.props.getOrElse("twirl.version", "1.5.1") // sync with documentation/project/plugins.sbt val interplay: String = sys.props.getOrElse("interplay.version", "2.1.8") diff --git a/scripts/clean-and-cross-publish-local b/scripts/clean-and-cross-publish-local deleted file mode 100755 index cd0d3825bf0..00000000000 --- a/scripts/clean-and-cross-publish-local +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (C) Lightbend Inc. - -# shellcheck source=scripts/scriptLib -. "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/scriptLib" - -cd "$BASEDIR" - -start clean "CLEANING IVY LOCAL REPO AND CACHE" -rm -rf $HOME/.ivy2/local -rm -rf $HOME/.ivy2/cache/com.typesafe.play/* -rm -rf $HOME/.ivy2/cache/scala_*/sbt_*/com.typesafe.play/* -find $HOME/.ivy2 -name "ivydata-*.properties" -delete -end clean "CLEANED IVY LOCAL REPO AND CACHE" - -start publish-local "CROSS-PUBLISHING PLAY LOCALLY FOR SBT SCRIPTED TESTS" -runSbt +publishLocal -end publish-local "CROSS-PUBLISHED PLAY LOCALLY FOR SBT SCRIPTED TESTS" diff --git a/scripts/it-test b/scripts/it-test deleted file mode 100755 index f095a4c1817..00000000000 --- a/scripts/it-test +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (C) Lightbend Inc. - -# shellcheck source=scripts/scriptLib -. "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/scriptLib" - -SCALA_VERSION=$1 - -if [ -z $SCALA_VERSION ]; then - echo "You need to pass the Scala version as argument to this script" - exit 1 -fi - -shift - -cd "$BASEDIR" - -start test "RUNNING IT TESTS FOR SCALA $SCALA_VERSION" - -runSbt "++${SCALA_VERSION} Play-Integration-Test/it:test" - -end test "ALL IT TESTS PASSED" diff --git a/scripts/local-pr-validation.sh b/scripts/local-pr-validation.sh deleted file mode 100755 index 5ae0693e627..00000000000 --- a/scripts/local-pr-validation.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (C) Lightbend Inc. - -# shellcheck source=scripts/scriptLib -. "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/scriptLib" - -start validation "RUNNING FRAMEWORK VALIDATION" -sbt headerCheck test:headerCheck javafmtCheckAll scalafmtCheckAll scalafmtSbtCheck || ( - echo "WARN: Format and/or license headers validaton failed." - echo "You need to run in sbt ';headerCreate ;Test/headerCreate ;javafmtAll ;scalafmtAll ;scalafmtSbt'" - echo "then commit the new changes or amend the existing commit." - echo "See more information about amending commits in our docs:" - echo "https://playframework.com/documentation/latest/WorkingWithGit" - false -) -start validation "FRAMEWORK VALIDATION DONE" - -pushd "$DOCUMENTATION" -start doc-validation "RUNNING DOCUMENTATION VALIDATION" -sbt headerCheck test:headerCheck javafmtCheckAll scalafmtCheckAll scalafmtSbtCheck || ( - echo "WARN: Format and/or license headers validaton failed." - echo "Inside the documentation/ folder you need to run in sbt ';headerCreate ;test:headerCreate ;javafmtAll ;scalafmtAll ;scalafmtSbt'" - echo "then commit the new changes or amend the existing commit." - echo "See more information about amending commits in our docs:" - echo "https://playframework.com/documentation/latest/WorkingWithGit" - false -) - -popd - -end doc-validation "ALL VALIDATIONS DONE" diff --git a/scripts/publish-local b/scripts/publish-local deleted file mode 100755 index 4edc71cca85..00000000000 --- a/scripts/publish-local +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (C) Lightbend Inc. - -# shellcheck source=scripts/scriptLib -. "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/scriptLib" - -cd "$BASEDIR" - -start clean "CLEANING IVY LOCAL REPO" -if [ "$TRAVIS" = "true" ]; then - rm -rf $HOME/.ivy2/local -else - # When running locally we want to keep other non play related artifacts - rm -rf $HOME/.ivy2/local/com.typesafe.play/ -fi -end clean "CLEANED IVY LOCAL REPO" - -start publish-local "CROSS-PUBLISHING PLAY LOCALLY FOR SBT SCRIPTED TESTS" -runSbt ";crossScalaVersions;crossSbtVersions;+publishLocal" -end publish-local "CROSS-PUBLISHED PLAY LOCALLY FOR SBT SCRIPTED TESTS" - -if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then - start save-akka-version "SAVING AKKA_VERSION AND AKKA_HTTP_VERSION" - echo "$AKKA_VERSION" > $HOME/.ivy2/local/com.typesafe.play/AKKA_VERSION - echo "$AKKA_HTTP_VERSION" > $HOME/.ivy2/local/com.typesafe.play/AKKA_HTTP_VERSION - end save-akka-version "SAVED AKKA_VERSION AND AKKA_HTTP_VERSION" -fi - -if [ "$TRAVIS" = "true" ]; then - start save-git-commit-hash "SAVING GIT COMMIT HASH" - git rev-parse HEAD > $HOME/.ivy2/local/com.typesafe.play/PUBLISHED_LOCAL_COMMIT_HASH - end save-git-commit-hash "SAVED GIT COMMIT HASH" -fi diff --git a/scripts/scriptLib b/scripts/scriptLib deleted file mode 100755 index 030c6620e6a..00000000000 --- a/scripts/scriptLib +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (C) Lightbend Inc. - -# Lib for CI scripts - -set -e -set -o pipefail - -DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) -BASEDIR=$DIR/.. -export DOCUMENTATION=$BASEDIR/documentation - -export CURRENT_BRANCH=${TRAVIS_BRANCH} - -AKKA_VERSION="" -AKKA_HTTP_VERSION="" - -# Check if it is a scheduled build -if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then - if [ -f $HOME/.ivy2/local/com.typesafe.play/AKKA_VERSION ]; then - AKKA_VERSION=$(cat $HOME/.ivy2/local/com.typesafe.play/AKKA_VERSION) - else - AKKA_VERSION=$(curl -s https://oss.sonatype.org/content/repositories/snapshots/com/typesafe/akka/akka-actor_2.13/ | grep -oEi '2\.6\.[0-9]+\+[RCM0-9]+-[0-9a-f]{8}-SNAPSHOT' | sort -V | tail -n 1) - fi - if [ -f $HOME/.ivy2/local/com.typesafe.play/AKKA_HTTP_VERSION ]; then - AKKA_HTTP_VERSION=$(cat $HOME/.ivy2/local/com.typesafe.play/AKKA_HTTP_VERSION) - else - AKKA_HTTP_VERSION=$(curl -s https://oss.sonatype.org/content/repositories/snapshots/com/typesafe/akka/akka-http-core_2.13/ | grep -oEi '10\.1\.[0-9]+\+[RCM0-9]+-[0-9a-f]{8}-SNAPSHOT' | sort -V | tail -n 1) - fi - - echo "Using Akka SNAPSHOT ${AKKA_VERSION} and Akka HTTP SNAPSHOT ${AKKA_HTTP_VERSION}" - - AKKA_VERSION_OPTS="-Dakka.version=${AKKA_VERSION}" - AKKA_HTTP_VERSION_OPTS="-Dakka.http.version=${AKKA_HTTP_VERSION}" -fi - -printMessage() { echo -e "\033[33;1m[info] ---- $1\033[0m"; } -start() { echo -e "travis_fold:start:$1\033[33;1m[info] ---- $2\033[0m" ; } -end() { echo -e "\ntravis_fold:end:$1\r\033[32;1m[info] ---- $2\033[0m" ; } - -runSbt() { - sbt "$AKKA_VERSION_OPTS" "$AKKA_HTTP_VERSION_OPTS" 'set concurrentRestrictions in Global += Tags.limitAll(1)' "$@" | grep --line-buffered -v 'Resolving \|Generating ' -} - -# Runs code formating validation in the current directory -scalafmtValidation() { - start validate-scalafmt "VALIDATE SCALA CODE FORMATTING" - runSbt +scalafmtCheckAll scalafmtSbtCheck || ( - echo "[error] ERROR: Scalafmt test failed for $1 source." - echo "[error] To fix, format your sources using 'sbt scalafmtAll scalafmtSbt' before submitting a pull request." - false - ) - ret=$? - end validate-scalafmt "VALIDATED SCALA CODE FORMATTING" - return $ret -} - -# Runs code formating validation in the current directory -javafmtValidation() { - start validate-javafmt "VALIDATE JAVA CODE FORMATTING" - runSbt javafmtCheckAll || ( - echo "[error] ERROR: javafmt check failed for $1 source." - echo "[error] To fix, format your sources using 'sbt javafmtAll' before submitting a pull request." - false - ) - ret=$? - end validate-javafmt "VALIDATE JAVA CODE FORMATTING" - return $ret -} - -setShellScalaVersionFromSbtVersion() { - case "$SBT_VERSION" in - 1*) SCALA_VERSION_SHELL="scalaVersion" ;; # Ends up "++scalaVersion", so nothing changes - 0.13*) SCALA_VERSION_SHELL="2.10.7" ;; - *) echo "Aborting: Failed to determine scala version for sbt $SBT_VERSION" >&2; exit 1 ;; - esac -} - -if [ "$TRAVIS" = "true" ]; then - start debug-env "SHOW FILES RELEVANT FOR THIS JOB AND ALL ENV VARIABLES" - echo "$ cat /etc/sbt/jvmopts" - cat /etc/sbt/jvmopts - echo "" - echo "$ cat /etc/sbt/sbtopts" - cat /etc/sbt/sbtopts - echo "" - echo "$ env" - env - end debug-env "SHOWED FILES RELEVANT FOR THIS JOB AND ALL ENV VARIABLES" -fi diff --git a/scripts/test b/scripts/test deleted file mode 100755 index 1c6a86f24f0..00000000000 --- a/scripts/test +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (C) Lightbend Inc. - -# shellcheck source=scripts/scriptLib -. "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/scriptLib" - -SCALA_VERSION=$1 - -if [ -z $SCALA_VERSION ]; then - echo "You need to pass the Scala version as argument to this script" - exit 1 -fi - -shift - -cd "$BASEDIR" - -start test "RUNNING TESTS FOR SCALA $SCALA_VERSION" - -runSbt "++${SCALA_VERSION} test" - -end test "ALL TESTS PASSED" diff --git a/scripts/test-docs b/scripts/test-docs deleted file mode 100755 index a4b4595107b..00000000000 --- a/scripts/test-docs +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (C) Lightbend Inc. - -# shellcheck source=scripts/scriptLib -. "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/scriptLib" - -SCALA_VERSION=$1 - -if [ -z $SCALA_VERSION ]; then - echo "You need to pass the Scala version as argument to this script" - exit 1 -fi - -shift - -cd "$DOCUMENTATION" - -start test "RUNNING DOCUMENTATION TESTS FOR SCALA $SCALA_VERSION" -runSbt "++${SCALA_VERSION} test" -end test "ALL DOCUMENTATION TESTS PASSED" diff --git a/scripts/test-scripted b/scripts/test-scripted deleted file mode 100755 index eebec2b2f08..00000000000 --- a/scripts/test-scripted +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (C) Lightbend Inc. - -# shellcheck source=scripts/scriptLib -. "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/scriptLib" - -SBT_VERSION=$1 - -if [ -z $SBT_VERSION ]; then - echo "You need to pass the sbt version as first and the Scala version as second argument to this script" - exit 1 -fi - -shift - -SCALA_VERSION=$1 - -if [ -z $SCALA_VERSION ]; then - echo "You need to pass the Scala version as second argument to this script" - exit 1 -fi - -shift - -# Set the $SCALA_VERSION_SHELL variable. -# When running scripted tests with sbt 0.13.x we need to switch the sbt shell to Scala 2.10, otherwise we run into: -# java.lang.NoSuchMethodError: scala.Predef$.refArrayOps([Ljava/lang/Object;)Lscala/collection/mutable/ArrayOps; -# This happens when listing the scripted tests. I guess that is because sbt shell starts with 1.3.x by default -# (and therefore Scala 2.12), but later "set scriptedSbt := 0.13.18" requires Scala 2.10 which is not "loaded" (?) -# The scripted tests itself however will always be run with $SBT_VERSION and $SCALA_VERSION, they never see $SCALA_VERSION_SHELL -setShellScalaVersionFromSbtVersion - -cd "$BASEDIR" - -start scripted "RUNNING SCRIPTED TESTS FOR SBT $SBT_VERSION AND SCALA $SCALA_VERSION" - -if [ "$TRAVIS" = "true" ]; then - # Make sure scripted tests run with the same git commit that was used for the publish-local job. - # For each CI job the CI server always clones the latest up-to-date base branch and, if the current job is for a pull request, - # then "fetches" the current pull request on top of it (just look at the logs of a PR job, you will see "git fetch origin +refs/pull/<#PR>/merge"). - # Now if another pull request gets merged in the time window during the publish-local and a scripted job, the base branches moves forward - # and the CI server will now clone that newer base branch before "fetching" the current PR on it. Of course now the commit hash has changed and - # the distance from the latest tag has increased, so the Play version set by dynver will be different than the one used for publish-local, resulting - # in "unresolved dependencies" errors. - PUBLISHED_LOCAL_COMMIT_HASH=$(cat $HOME/.ivy2/local/com.typesafe.play/PUBLISHED_LOCAL_COMMIT_HASH) - git fetch origin ${PUBLISHED_LOCAL_COMMIT_HASH} - git checkout ${PUBLISHED_LOCAL_COMMIT_HASH} - echo "Checked out git commit ${PUBLISHED_LOCAL_COMMIT_HASH} which was used for publish-local in previous job" - - # This is just for "debugging" - ls -alFhR ~/.ivy2 | grep play | grep jar - ls -alFhR ~/.cache/coursier | grep play | grep jar -fi -runSbt ";project Sbt-Plugin;set scriptedSbt := \"${SBT_VERSION}\";set scriptedLaunchOpts += \"-Dscala.version=${SCALA_VERSION}\";++$SCALA_VERSION_SHELL;show scriptedSbt;show scriptedLaunchOpts;scripted $@" -end scripted "ALL SCRIPTED TESTS PASSED" diff --git a/scripts/validate-code b/scripts/validate-code deleted file mode 100755 index 1d4aaa7dcf8..00000000000 --- a/scripts/validate-code +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (C) Lightbend Inc. - -# shellcheck source=scripts/scriptLib -. "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/scriptLib" - -cd "$BASEDIR" - -scalafmtValidation "framework" -javafmtValidation "framework" - - -start mima "VALIDATE BINARY COMPATIBILITY" -runSbt +mimaReportBinaryIssues -end mima "VALIDATED BINARY COMPATIBILITY" - - -start headerCheck "VALIDATE FILE LICENSE HEADERS" -runSbt +headerCheck +test:headerCheck Play-Microbenchmark/test:headerCheck -end headerCheck "VALIDATED FILE LICENSE HEADERS" diff --git a/scripts/validate-docs b/scripts/validate-docs deleted file mode 100755 index e7a361e2805..00000000000 --- a/scripts/validate-docs +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (C) Lightbend Inc. - -# shellcheck source=scripts/scriptLib -. "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/scriptLib" - -cd "$DOCUMENTATION" - -start validate-docs "RUNNING DOCUMENTATION VALIDATION" -runSbt evaluateSbtFiles -runSbt validateDocs -runSbt headerCheck test:headerCheck - -scalafmtValidation "documentation" -javafmtValidation "documentation" - -end validate-docs "ALL DOCUMENTATION VALIDATION PASSED" - -# Check that markdown files have copyright headers - -./addMarkdownCopyright - -# Only checks diffs inside the documentation directory -git diff --exit-code . || ( - echo "ERROR: Documentation copyright or sources license header check failed, see differences above." - echo "To fix, run the './addMarkdownCopyright' script inside the documentation directory or 'sbt test:compile' at the root of the repo." - echo "After that you can update your pull request." - false -) diff --git a/scripts/validate-microbenchmarks b/scripts/validate-microbenchmarks deleted file mode 100755 index 9e693aa5980..00000000000 --- a/scripts/validate-microbenchmarks +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (C) Lightbend Inc. - -# shellcheck source=scripts/scriptLib -. "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/scriptLib" - -cd "$BASEDIR" - -# Don't build first, let sbt automatically build any dependencies that -# are needed when we run the microbenchmarks. This should be quicker -# than doing an explicit publish step. - -start validate "VALIDATING MICROBENCHMARKS" - -# Just run single iteration of microbenchmark to test that they -# run properly. The results will be inaccurate, but this ensures that -# the microbenchmarks at least compile and run. - -# We are using double-double quotes here so that the command -# is passed to runSbt as a single command and internally be -# passed to sbt as a single command too. -# foe = FailOnError http://mail.openjdk.java.net/pipermail/jmh-dev/2015-February/001685.html -runSbt "Play-Microbenchmark/jmh:run -i 1 -wi 0 -f 1 -t 1 -foe=true" - -end validate "BENCHMARKS VALIDATED" diff --git a/testkit/play-specs2/src/test/resources/logback-test.xml b/testkit/play-specs2/src/test/resources/logback-test.xml index 36d5a155617..eaf9e018b62 100644 --- a/testkit/play-specs2/src/test/resources/logback-test.xml +++ b/testkit/play-specs2/src/test/resources/logback-test.xml @@ -8,7 +8,7 @@ - + %level %logger{15} - %message%n%ex{short} diff --git a/testkit/play-test/src/test/resources/logback-test.xml b/testkit/play-test/src/test/resources/logback-test.xml index 36d5a155617..eaf9e018b62 100644 --- a/testkit/play-test/src/test/resources/logback-test.xml +++ b/testkit/play-test/src/test/resources/logback-test.xml @@ -8,7 +8,7 @@ - + %level %logger{15} - %message%n%ex{short} diff --git a/transport/client/play-ahc-ws/src/test/resources/logback-test.xml b/transport/client/play-ahc-ws/src/test/resources/logback-test.xml index dcd261d2a3c..af6674e7151 100644 --- a/transport/client/play-ahc-ws/src/test/resources/logback-test.xml +++ b/transport/client/play-ahc-ws/src/test/resources/logback-test.xml @@ -8,7 +8,7 @@ - + %level %logger{15} - %message%n%ex{short} diff --git a/transport/server/play-server/src/test/resources/logback-test.xml b/transport/server/play-server/src/test/resources/logback-test.xml index 36d5a155617..eaf9e018b62 100644 --- a/transport/server/play-server/src/test/resources/logback-test.xml +++ b/transport/server/play-server/src/test/resources/logback-test.xml @@ -8,7 +8,7 @@ - + %level %logger{15} - %message%n%ex{short} diff --git a/web/play-filters-helpers/src/test/resources/logback-test.xml b/web/play-filters-helpers/src/test/resources/logback-test.xml index 36d5a155617..eaf9e018b62 100644 --- a/web/play-filters-helpers/src/test/resources/logback-test.xml +++ b/web/play-filters-helpers/src/test/resources/logback-test.xml @@ -8,7 +8,7 @@ - + %level %logger{15} - %message%n%ex{short} diff --git a/web/play-openid/src/test/resources/logback-test.xml b/web/play-openid/src/test/resources/logback-test.xml index 36d5a155617..eaf9e018b62 100644 --- a/web/play-openid/src/test/resources/logback-test.xml +++ b/web/play-openid/src/test/resources/logback-test.xml @@ -8,7 +8,7 @@ - + %level %logger{15} - %message%n%ex{short}