forked from flock-community/kotlin-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Author: 梦境迷离 <[email protected]> Date: Sat Oct 7 10:45:58 2023 +0800
- Loading branch information
1 parent
53916e2
commit 8bd3657
Showing
15 changed files
with
336 additions
and
251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: [ "*" ] | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
java-version: [ 11 ] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup JDK | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: ${{ matrix.java-version }} | ||
- name: Cache scala dependencies | ||
uses: coursier/cache-action@v6 | ||
|
||
- name: Checking Code style | ||
run: sbt check | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup JDK | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 11 | ||
|
||
- name: Run Test | ||
if: success() || failure() | ||
run: sbt coverage test | ||
|
||
- name: Aggregate coverage report | ||
run: sbt coverageAggregate | ||
|
||
- name: Upload test coverage report | ||
run: bash <(curl -s https://codecov.io/bash) | ||
|
||
publish: | ||
runs-on: ubuntu-latest | ||
needs: [ check ] | ||
if: github.event_name != 'pull_request' | ||
steps: | ||
- name: Checkout current branch | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup JDK | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 11 | ||
|
||
- name: Release artifacts | ||
run: sbt ci-release | ||
env: | ||
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} | ||
PGP_SECRET: ${{ secrets.PGP_SECRET }} | ||
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | ||
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | ||
|
||
ci: | ||
runs-on: ubuntu-latest | ||
needs: [ check, test ] | ||
steps: | ||
- name: Aggregate outcomes | ||
run: echo "build succeeded" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
version = "3.7.13" | ||
runner.dialect = scala3 | ||
maxColumn = 120 | ||
align.preset = more | ||
lineEndings = preserve | ||
align.stripMargin = false | ||
docstrings.style = AsteriskSpace | ||
docstrings.oneline = keep | ||
continuationIndent.defnSite = 2 | ||
danglingParentheses.preset = true | ||
spaces.inImportCurlyBraces = true | ||
indentOperator.exemptScope = aloneArgOrBody | ||
includeCurlyBraceInSelectChains = false | ||
align.openParenDefnSite = false | ||
optIn.annotationNewlines = true | ||
rewriteTokens = { | ||
"⇒": "=>" | ||
"→": "->" | ||
"←": "<-" | ||
} | ||
rewrite.rules = [Imports] | ||
rewrite.imports.sort = scalastyle | ||
rewrite.imports.groups = [ | ||
["java\\..*", "javax\\..*"], | ||
["scala\\..*"] | ||
["bitlap\\..*"], | ||
["org\\..*"], | ||
["com\\..*"], | ||
] | ||
rewrite.imports.contiguousGroups = no | ||
newlines.topLevelStatementBlankLines = [ | ||
{ | ||
blanks {before = 1} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,42 @@ | ||
name := "sbt-kotlin-plugin" | ||
|
||
organization := "community.flock.sbt" | ||
|
||
version := "3.0.1" | ||
|
||
scalacOptions ++= Seq("-deprecation","-Xlint","-feature") | ||
|
||
libraryDependencies ++= Seq( | ||
"io.argonaut" %% "argonaut" % "6.2", | ||
"org.scalaz" %% "scalaz-core" % "7.2.28" | ||
addCommandAlias("fmt", "scalafmt") | ||
addCommandAlias("check", "scalafmtCheckAll") | ||
|
||
inThisBuild( | ||
List( | ||
organization := "org.bitlap", | ||
organizationName := "sbt-kotlin-plugin", | ||
sonatypeCredentialHost := "s01.oss.sonatype.org", | ||
sonatypeRepository := "https://s01.oss.sonatype.org/service/local", | ||
homepage := Some(url("https://github.com/bitlap/kotlin-plugin")), | ||
licenses := List( | ||
"MIT" -> url("https://opensource.org/licenses/MIT") | ||
), | ||
developers := List( | ||
Developer( | ||
id = "jxnu-liguobin", | ||
name = "梦境迷离", | ||
email = "[email protected]", | ||
url = url("https://blog.dreamylost.cn") | ||
) | ||
) | ||
) | ||
) | ||
|
||
sbtPlugin := true | ||
|
||
// build info plugin | ||
|
||
enablePlugins(BuildInfoPlugin, SbtPlugin) | ||
|
||
buildInfoPackage := "kotlin" | ||
|
||
// scripted | ||
scriptedLaunchOpts ++= Seq( | ||
"-Xmx1024m", | ||
"-Dplugin.version=" + version.value | ||
) | ||
lazy val `sbt-kotlin-plugin` = (project in file(".")) | ||
.settings( | ||
name := "sbt-kotlin-plugin", | ||
organization := "org.bitlap", | ||
scalacOptions ++= Seq("-deprecation", "-Xlint", "-feature"), | ||
libraryDependencies ++= Seq( | ||
"io.argonaut" %% "argonaut" % "6.2", | ||
"org.scalaz" %% "scalaz-core" % "7.2.28" | ||
), | ||
sbtPlugin := true, | ||
buildInfoPackage := "kotlin", | ||
// scripted | ||
scriptedLaunchOpts ++= Seq( | ||
"-Xmx1024m", | ||
"-Dplugin.version=" + version.value | ||
) | ||
) | ||
.enablePlugins(BuildInfoPlugin, SbtPlugin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
libraryDependencies += "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value | ||
|
||
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.9.0") | ||
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2") | ||
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2") | ||
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12") | ||
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2") |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.