Skip to content

Commit

Permalink
Try out sbt-typelevel
Browse files Browse the repository at this point in the history
  • Loading branch information
rossabaker committed Jan 2, 2022
1 parent ecf2183 commit 12df1a6
Show file tree
Hide file tree
Showing 14 changed files with 118 additions and 45 deletions.
2 changes: 2 additions & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
version = 3.3.1

runner.dialect = Scala213Source3

style = default

maxColumn = 100
Expand Down
12 changes: 11 additions & 1 deletion bench/src/main/scala/com/rossabaker/ci/bench/CIStringBench.scala
Original file line number Diff line number Diff line change
@@ -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
Expand Down
37 changes: 3 additions & 34 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(
Expand All @@ -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(
Expand Down Expand Up @@ -78,7 +69,6 @@ lazy val bench = project
.in(file("bench"))
.enablePlugins(NoPublishPlugin)
.enablePlugins(JmhPlugin)
.settings(commonSettings)
.settings(
name := "case-insensitive-bench"
)
Expand All @@ -89,7 +79,6 @@ lazy val site = project
.enablePlugins(MicrositesPlugin)
.enablePlugins(MdocPlugin)
.enablePlugins(NoPublishPlugin)
.settings(commonSettings)
.dependsOn(core.jvm, testing.jvm)
.settings {
import microsites._
Expand Down Expand Up @@ -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(
Expand Down
12 changes: 11 additions & 1 deletion core/src/main/scala-2.12/org/typelevel/ci/compat.scala
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 11 additions & 1 deletion core/src/main/scala-2.13/org/typelevel/ci/compat.scala
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 11 additions & 1 deletion core/src/main/scala-3/org/typelevel/ci/compat.scala
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 11 additions & 1 deletion core/src/main/scala/org/typelevel/ci/CIString.scala
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 11 additions & 1 deletion core/src/main/scala/org/typelevel/ci/package.scala
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions project/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
resolvers += Resolver.sonatypeRepo("snapshots")
3 changes: 2 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 11 additions & 1 deletion tests/jvm/src/test/scala/org/typelevel/ci/CIStringJVMSuite.scala
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 11 additions & 1 deletion tests/shared/src/test/scala/org/typelevel/ci/CIStringSuite.scala
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 11 additions & 1 deletion tests/shared/src/test/scala/org/typelevel/ci/TurkeySuite.scala
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 12df1a6

Please sign in to comment.