From 12df1a62b08efcd3ca311ff1dec68715311ef3b9 Mon Sep 17 00:00:00 2001 From: "Ross A. Baker" Date: Sun, 2 Jan 2022 13:51:17 -0500 Subject: [PATCH] Try out sbt-typelevel --- .scalafmt.conf | 2 + .../rossabaker/ci/bench/CIStringBench.scala | 12 +++++- build.sbt | 37 ++----------------- .../scala-2.12/org/typelevel/ci/compat.scala | 12 +++++- .../scala-2.13/org/typelevel/ci/compat.scala | 12 +++++- .../scala-3/org/typelevel/ci/compat.scala | 12 +++++- .../scala/org/typelevel/ci/CIString.scala | 12 +++++- .../main/scala/org/typelevel/ci/package.scala | 12 +++++- project/build.sbt | 1 + project/plugins.sbt | 3 +- .../typelevel/ci/testing/arbitraries.scala | 12 +++++- .../org/typelevel/ci/CIStringJVMSuite.scala | 12 +++++- .../org/typelevel/ci/CIStringSuite.scala | 12 +++++- .../scala/org/typelevel/ci/TurkeySuite.scala | 12 +++++- 14 files changed, 118 insertions(+), 45 deletions(-) create mode 100644 project/build.sbt diff --git a/.scalafmt.conf b/.scalafmt.conf index 16a4641..4cefc1e 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,5 +1,7 @@ version = 3.3.1 +runner.dialect = Scala213Source3 + style = default maxColumn = 100 diff --git a/bench/src/main/scala/com/rossabaker/ci/bench/CIStringBench.scala b/bench/src/main/scala/com/rossabaker/ci/bench/CIStringBench.scala index e2a801e..72c90be 100644 --- a/bench/src/main/scala/com/rossabaker/ci/bench/CIStringBench.scala +++ b/bench/src/main/scala/com/rossabaker/ci/bench/CIStringBench.scala @@ -1,7 +1,17 @@ /* * Copyright 2020 Typelevel * - * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.typelevel.ci diff --git a/build.sbt b/build.sbt index 6fdadd8..9a0d5f9 100644 --- a/build.sbt +++ b/build.sbt @@ -6,7 +6,7 @@ val catsV = "2.7.0" val scalacheckV = "1.15.4" val disciplineMunitV = "1.0.9" -enablePlugins(SonatypeCiReleasePlugin) +enablePlugins(TypelevelCiReleasePlugin) // Projects lazy val `case-insensitive` = project @@ -17,24 +17,16 @@ lazy val `case-insensitive` = project lazy val core = crossProject(JSPlatform, JVMPlatform) .crossType(CrossType.Pure) .in(file("core")) - .settings(commonSettings) .settings( name := "case-insensitive", libraryDependencies ++= Seq( "org.typelevel" %%% "cats-core" % catsV - ), - Compile / unmanagedSourceDirectories ++= { - val major = if (isDotty.value) "-3" else "-2" - List(CrossType.Pure, CrossType.Full).flatMap( - _.sharedSrcDir(baseDirectory.value, "main").toList.map(f => file(f.getPath + major)) - ) - } + ) ) lazy val testing = crossProject(JSPlatform, JVMPlatform) .crossType(CrossType.Pure) .in(file("testing")) - .settings(commonSettings) .settings( name := "case-insensitive-testing", libraryDependencies ++= Seq( @@ -50,7 +42,6 @@ lazy val tests = crossProject(JSPlatform, JVMPlatform) .crossType(CrossType.Full) .in(file("tests")) .enablePlugins(NoPublishPlugin) - .settings(commonSettings) .settings( name := "case-insensitive-tests", libraryDependencies ++= Seq( @@ -78,7 +69,6 @@ lazy val bench = project .in(file("bench")) .enablePlugins(NoPublishPlugin) .enablePlugins(JmhPlugin) - .settings(commonSettings) .settings( name := "case-insensitive-bench" ) @@ -89,7 +79,6 @@ lazy val site = project .enablePlugins(MicrositesPlugin) .enablePlugins(MdocPlugin) .enablePlugins(NoPublishPlugin) - .settings(commonSettings) .dependsOn(core.jvm, testing.jvm) .settings { import microsites._ @@ -129,36 +118,16 @@ lazy val site = project ), } -// General Settings -lazy val commonSettings = Seq( - headerLicenseStyle := HeaderLicenseStyle.SpdxSyntax -) ++ automateHeaderSettings(Compile, Test) - val Scala213 = "2.13.7" val Scala213Cond = s"matrix.scala == '$Scala213'" // General Settings inThisBuild( List( - organization := "org.typelevel", - organizationName := "Typelevel", - publishGithubUser := "rossabaker", - publishFullName := "Ross A. Baker", - baseVersion := "1.1", + tlBaseVersion := "1.2", crossScalaVersions := Seq("2.12.15", Scala213, "3.0.2"), - scalaVersion := crossScalaVersions.value.filter(_.startsWith("2.")).last, - versionIntroduced := Map( - "3.0.0-RC1" -> "1.0.0", - "3.0.0-RC2" -> "1.0.1", - "3.0.0-RC3" -> "1.1.3" - ), homepage := Some(url("https://github.com/typelevel/case-insensitive")), startYear := Some(2020), - licenses := Seq("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0.html")), - scmInfo := Some( - ScmInfo( - url("https://github.com/typelevel/case-insensitive"), - "git@github.com:typelevel/case-insensitive.git")), githubWorkflowTargetTags ++= Seq("v*"), githubWorkflowPublishTargetBranches := Seq(RefPredicate.StartsWith(Ref.Tag("v"))), githubWorkflowBuildPreamble ++= Seq( diff --git a/core/src/main/scala-2.12/org/typelevel/ci/compat.scala b/core/src/main/scala-2.12/org/typelevel/ci/compat.scala index 94fd041..b594d80 100644 --- a/core/src/main/scala-2.12/org/typelevel/ci/compat.scala +++ b/core/src/main/scala-2.12/org/typelevel/ci/compat.scala @@ -1,7 +1,17 @@ /* * Copyright 2020 Typelevel * - * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.typelevel.ci diff --git a/core/src/main/scala-2.13/org/typelevel/ci/compat.scala b/core/src/main/scala-2.13/org/typelevel/ci/compat.scala index f309eb1..d4dd4d0 100644 --- a/core/src/main/scala-2.13/org/typelevel/ci/compat.scala +++ b/core/src/main/scala-2.13/org/typelevel/ci/compat.scala @@ -1,7 +1,17 @@ /* * Copyright 2020 Typelevel * - * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.typelevel.ci diff --git a/core/src/main/scala-3/org/typelevel/ci/compat.scala b/core/src/main/scala-3/org/typelevel/ci/compat.scala index f309eb1..d4dd4d0 100644 --- a/core/src/main/scala-3/org/typelevel/ci/compat.scala +++ b/core/src/main/scala-3/org/typelevel/ci/compat.scala @@ -1,7 +1,17 @@ /* * Copyright 2020 Typelevel * - * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.typelevel.ci diff --git a/core/src/main/scala/org/typelevel/ci/CIString.scala b/core/src/main/scala/org/typelevel/ci/CIString.scala index 0e98cb8..13710be 100644 --- a/core/src/main/scala/org/typelevel/ci/CIString.scala +++ b/core/src/main/scala/org/typelevel/ci/CIString.scala @@ -1,7 +1,17 @@ /* * Copyright 2020 Typelevel * - * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.typelevel.ci diff --git a/core/src/main/scala/org/typelevel/ci/package.scala b/core/src/main/scala/org/typelevel/ci/package.scala index 19b542d..5f3e4cd 100644 --- a/core/src/main/scala/org/typelevel/ci/package.scala +++ b/core/src/main/scala/org/typelevel/ci/package.scala @@ -1,7 +1,17 @@ /* * Copyright 2020 Typelevel * - * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.typelevel diff --git a/project/build.sbt b/project/build.sbt new file mode 100644 index 0000000..7719321 --- /dev/null +++ b/project/build.sbt @@ -0,0 +1 @@ +resolvers += Resolver.sonatypeRepo("snapshots") diff --git a/project/plugins.sbt b/project/plugins.sbt index 8f2bc26..2da7d5d 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,5 +1,6 @@ addSbtPlugin("com.47deg" % "sbt-microsites" % "1.3.4") -addSbtPlugin("com.codecommit" % "sbt-spiewak-sonatype" % "0.22.1") +addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.4-ac41c6a-SNAPSHOT") +addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0") addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.24") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6") addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.3") diff --git a/testing/src/main/scala/org/typelevel/ci/testing/arbitraries.scala b/testing/src/main/scala/org/typelevel/ci/testing/arbitraries.scala index 08e1ac7..c7ea175 100644 --- a/testing/src/main/scala/org/typelevel/ci/testing/arbitraries.scala +++ b/testing/src/main/scala/org/typelevel/ci/testing/arbitraries.scala @@ -1,7 +1,17 @@ /* * Copyright 2020 Typelevel * - * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.typelevel.ci diff --git a/tests/jvm/src/test/scala/org/typelevel/ci/CIStringJVMSuite.scala b/tests/jvm/src/test/scala/org/typelevel/ci/CIStringJVMSuite.scala index 4cfb95a..25612d6 100644 --- a/tests/jvm/src/test/scala/org/typelevel/ci/CIStringJVMSuite.scala +++ b/tests/jvm/src/test/scala/org/typelevel/ci/CIStringJVMSuite.scala @@ -1,7 +1,17 @@ /* * Copyright 2020 Typelevel * - * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.typelevel.ci diff --git a/tests/shared/src/test/scala/org/typelevel/ci/CIStringSuite.scala b/tests/shared/src/test/scala/org/typelevel/ci/CIStringSuite.scala index 412632b..4ef1706 100644 --- a/tests/shared/src/test/scala/org/typelevel/ci/CIStringSuite.scala +++ b/tests/shared/src/test/scala/org/typelevel/ci/CIStringSuite.scala @@ -1,7 +1,17 @@ /* * Copyright 2020 Typelevel * - * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.typelevel.ci diff --git a/tests/shared/src/test/scala/org/typelevel/ci/TurkeySuite.scala b/tests/shared/src/test/scala/org/typelevel/ci/TurkeySuite.scala index b45f08e..bbb9347 100644 --- a/tests/shared/src/test/scala/org/typelevel/ci/TurkeySuite.scala +++ b/tests/shared/src/test/scala/org/typelevel/ci/TurkeySuite.scala @@ -1,7 +1,17 @@ /* * Copyright 2020 Typelevel * - * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.typelevel.ci