Skip to content
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

Fix plugin version #21

Merged
merged 2 commits into from
May 30, 2023
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
30 changes: 8 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,27 @@ jobs:
matrix:
os: [ubuntu-latest]
scala: [2.13.10]
java: [temurin@11, temurin@17, temurin@19]
java: [temurin@17, temurin@20]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Java (temurin@11)
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 11

- name: Setup Java (temurin@17)
if: matrix.java == 'temurin@17'
uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 17

- name: Setup Java (temurin@19)
if: matrix.java == 'temurin@19'
- name: Setup Java (temurin@20)
if: matrix.java == 'temurin@20'
uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 19
java-version: 20

- name: Cache sbt
uses: actions/cache@v2
Expand Down Expand Up @@ -104,34 +97,27 @@ jobs:
matrix:
os: [ubuntu-latest]
scala: [2.13.10]
java: [temurin@11]
java: [temurin@17]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Java (temurin@11)
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 11

- name: Setup Java (temurin@17)
if: matrix.java == 'temurin@17'
uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 17

- name: Setup Java (temurin@19)
if: matrix.java == 'temurin@19'
- name: Setup Java (temurin@20)
if: matrix.java == 'temurin@20'
uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 19
java-version: 20

- name: Cache sbt
uses: actions/cache@v2
Expand Down
3 changes: 1 addition & 2 deletions github-actions.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ ThisBuild / githubWorkflowBuild := Seq(
// Add macos-latest when step to install docker on it is done
ThisBuild / githubWorkflowOSes := Seq("ubuntu-latest")
ThisBuild / githubWorkflowJavaVersions := Seq(
JavaSpec.temurin("11"),
JavaSpec.temurin("17"),
JavaSpec.temurin("19")
JavaSpec.temurin("20")
)
ThisBuild / githubWorkflowTargetBranches := Seq("main")
ThisBuild / githubWorkflowTargetTags := Seq("v*")
Expand Down
18 changes: 0 additions & 18 deletions modules/plugin/pact-plugin.json

This file was deleted.

2 changes: 1 addition & 1 deletion project/BuildSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import sbt._
import java.util

object BuildSettings {
private val javaVersion = 11
private val javaVersion = 17
private val env: util.Map[String, String] = System.getenv()
val scala213 = "2.13.10"

Expand Down
10 changes: 5 additions & 5 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ object Dependencies extends DependencyUtils {
object Versions {
val avro = "1.11.1"
val logback = "1.2.11"
val pact = "4.5.5"
val pact = "4.6.0"
val pulsar4sVersion = "2.9.0"
val scalaTest = "3.2.15"
val scalaTest = "3.2.16"
}

// protobuf Dependencies
Expand All @@ -21,15 +21,15 @@ object Dependencies extends DependencyUtils {
ExclusionRule("io.pact.plugin.driver"),
ExclusionRule("org.slf4j")
)
val logback: ModuleID = "ch.qos.logback" % "logback-classic" % "1.4.6"
val pactCore: ModuleID = "io.pact.plugin.driver" % "core" % "0.3.2" excludeAll (
val logback: ModuleID = "ch.qos.logback" % "logback-classic" % "1.4.7"
val pactCore: ModuleID = "io.pact.plugin.driver" % "core" % "0.4.0" excludeAll (
ExclusionRule("au.com.dius.pact.core"),
ExclusionRule("org.slf4j")
)
val scalaLogging: ModuleID = "com.typesafe.scala-logging" %% "scala-logging" % "3.9.5" excludeAll ExclusionRule("org.slf4j")
val scalaPBRuntime = "com.thesamet.scalapb" %% "scalapb-runtime-grpc" % scalapb.compiler.Version.scalapbVersion
val slf4jApi: ModuleID = "org.slf4j" %% "slf4j-api" % "2.0.6"
val pureConfig: ModuleID = "com.github.pureconfig" %% "pureconfig" % "0.17.2"
val pureConfig: ModuleID = "com.github.pureconfig" %% "pureconfig" % "0.17.4"

// Test dependencies
val assertJCore: ModuleID = "org.assertj" % "assertj-core" % "3.24.2"
Expand Down
41 changes: 41 additions & 0 deletions project/PactPluginJson.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import upickle.default

case class PactPluginDependency(name: String, version: String, `type`: String)

object PactPluginDependency {
implicit val pactPluginDependencyRW: default.ReadWriter[PactPluginDependency] = upickle.default.macroRW[PactPluginDependency]
}

case class PactPluginJson(
manifestVersion: Int,
pluginInterfaceVersion: Int,
name: String,
version: String,
executableType: String,
entryPoint: String,
entryPoints: Map[String, String],
dependencies: List[PactPluginDependency]
)
object PactPluginJson {
implicit val pactPluginJsonRW: default.ReadWriter[PactPluginJson] = upickle.default.macroRW[PactPluginJson]
def json(v: String): String = upickle.default.write(
PactPluginJson(
manifestVersion = 1,
pluginInterfaceVersion = 1,
name = "avro",
version = v,
executableType = "exec",
entryPoint = "bin/pact-avro-plugin",
entryPoints = Map(
"windows" -> "bin/pact-avro-plugin.bat"
),
dependencies = List(
PactPluginDependency(
name = "jvm",
version = "11+",
`type` = "OSPackage"
)
)
)
)
}
7 changes: 6 additions & 1 deletion project/PublishSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@ object PublishSettings {
executableScriptName := "pact-avro-plugin",
Compile / doc / sources := Seq.empty,
Compile / packageDoc / mappings := Seq.empty,
Compile / resourceGenerators += Def.task {
val file = (Compile / resourceManaged).value / "pact-plugin.json"
IO.write(file, PactPluginJson.json(version.value))
Seq(file)
},
Universal / mappings ++= Seq(
sourceDirectory.value / "main" / "resources" / "logback.xml" -> "conf/logback.xml",
baseDirectory.value / "pact-plugin.json" -> "pact-plugin.json"
(Compile / resourceManaged).value / "pact-plugin.json" -> "pact-plugin.json"
),
Universal / javaOptions ++= Seq(
"-Dfile.encoding=UTF-8",
Expand Down
3 changes: 3 additions & 0 deletions project/builds.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
libraryDependencies ++= List(
"com.lihaoyi" %% "upickle" % "3.1.0"
)
2 changes: 1 addition & 1 deletion project/sbt-grpc.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
addSbtPlugin("com.thesamet" % "sbt-protoc" % "1.0.6")

libraryDependencies += "com.thesamet.scalapb" %% "compilerplugin" % "0.11.11"
libraryDependencies += "com.thesamet.scalapb" %% "compilerplugin" % "0.11.13"