-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
19ada60
commit e327015
Showing
30 changed files
with
254 additions
and
238 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
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
14 changes: 14 additions & 0 deletions
14
plugin/src/main/scala-2.12/com/github/sbt/avro/PluginCompat.scala
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,14 @@ | ||
package com.github.sbt.avro | ||
import sbt.* | ||
import xsbti.FileConverter | ||
|
||
import java.nio.file.{Path => NioPath} | ||
|
||
private[avro] object PluginCompat { | ||
type FileRef = java.io.File | ||
type Out = java.io.File | ||
|
||
def toNioPath(a: Attributed[File])(implicit conv: FileConverter): NioPath = | ||
a.data.toPath() | ||
def toFileRef(f: File): FileRef = f | ||
} |
14 changes: 14 additions & 0 deletions
14
plugin/src/main/scala-3/com/github/sbt/avro/PluginCompat.scala
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,14 @@ | ||
package com.github.sbt.avro | ||
|
||
import java.nio.file.{Path => NioPath} | ||
import sbt.* | ||
import xsbti.{FileConverter, HashedVirtualFileRef, VirtualFile} | ||
|
||
private[avro] object PluginCompat: | ||
type FileRef = HashedVirtualFileRef | ||
type Out = VirtualFile | ||
|
||
def toNioPath(a: Attributed[HashedVirtualFileRef])(using conv: FileConverter): NioPath = | ||
conv.toPath(a.data) | ||
|
||
def toFileRef(f: File)(using conv: FileConverter): FileRef = conv.toVirtualFile(f.toPath) |
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
1 change: 0 additions & 1 deletion
1
plugin/src/sbt-test/sbt-avro/avscparser/project/build.properties
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 |
---|---|---|
@@ -1,17 +1,96 @@ | ||
ThisBuild / scalaVersion := "2.13.11" | ||
|
||
lazy val basic = crossProject( | ||
Avro("1.12.0"), | ||
Avro("1.11.3"), | ||
Avro("1.10.0"), | ||
Avro("1.9.2"), | ||
Avro("1.8.2"), | ||
) | ||
.crossType(CrossType.Pure) | ||
lazy val files = Seq( | ||
"A", "B", "C", "D", "E", "_A", "_B", "_C", "_D", "_E", "LogicalTypesTest" | ||
) | ||
|
||
lazy val testFiles = Seq( | ||
"X", "Y", "Z" | ||
) | ||
|
||
val checkGenerated = TaskKey[Unit]("checkGenerated") | ||
val checkCompiled = TaskKey[Unit]("checkCompiled") | ||
|
||
def exists(f: File): Unit = assert(f.exists(), s"$f does not exist") | ||
|
||
val checkSettings = inConfig(Compile)(Def.settings( | ||
checkGenerated := { | ||
files.foreach { f => | ||
exists(crossTarget.value / "src_managed" / "compiled_avro" / "main" / "com" / "github" / "sbt" / "avro" / "test" / s"$f.java") | ||
} | ||
}, | ||
checkCompiled := { | ||
files.foreach { f => | ||
exists(classDirectory.value / "com" / "github" / "sbt" / "avro" / "test" / s"$f.class") | ||
} | ||
} | ||
)) ++ inConfig(Test)(Def.settings( | ||
checkGenerated := { | ||
testFiles.foreach { f => | ||
exists(crossTarget.value / "src_managed" / "compiled_avro" / "test" / "com" / "github" / "sbt" / "avro" / "test" / s"$f.java") | ||
} | ||
}, | ||
checkCompiled := { | ||
testFiles.foreach { f => | ||
exists(classDirectory.value / "com" / "github" / "sbt" / "avro" / "test" / s"$f.class") | ||
} | ||
} | ||
)) | ||
|
||
|
||
lazy val `basic` = project | ||
.in(file(".")) | ||
.avroSettings("1.9.2")( | ||
libraryDependencies += "joda-time" % "joda-time" % "2.12.7" | ||
.aggregate( | ||
`basic8`, | ||
`basic9`, | ||
`basic10`, | ||
`basic11`, | ||
`basic12` | ||
) | ||
|
||
lazy val `basic8` = project | ||
.in(file(".basic_8")) | ||
.enablePlugins(SbtAvro) | ||
.settings(checkSettings) | ||
.settings( | ||
avroVersion := "1.8.2", | ||
libraryDependencies += "joda-time" % "joda-time" % "2.12.7", | ||
sourceDirectory := file(".") / "src" | ||
) | ||
|
||
lazy val `basic9` = project | ||
.in(file(".basic_9")) | ||
.enablePlugins(SbtAvro) | ||
.settings(checkSettings) | ||
.settings( | ||
avroVersion := "1.9.2", | ||
libraryDependencies += "joda-time" % "joda-time" % "2.12.7", | ||
sourceDirectory := file(".") / "src" | ||
) | ||
|
||
lazy val `basic10` = project | ||
.in(file(".basic_10")) | ||
.enablePlugins(SbtAvro) | ||
.settings(checkSettings) | ||
.settings( | ||
avroVersion := "1.10.0", | ||
sourceDirectory := file(".") / "src" | ||
) | ||
|
||
lazy val `basic11` = project | ||
.in(file(".basic_11")) | ||
.enablePlugins(SbtAvro) | ||
.settings(checkSettings) | ||
.settings( | ||
avroVersion := "1.11.3", | ||
sourceDirectory := file(".") / "src" | ||
) | ||
.avroSettings("1.8.2")( | ||
libraryDependencies += "joda-time" % "joda-time" % "2.12.7" | ||
|
||
lazy val `basic12` = project | ||
.in(file(".basic_12")) | ||
.enablePlugins(SbtAvro) | ||
.settings(checkSettings) | ||
.settings( | ||
avroVersion := "1.12.0", | ||
sourceDirectory := file(".") / "src" | ||
) |
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
plugin/src/sbt-test/sbt-avro/basic/project/AvroCrossPlugin.scala
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
2 changes: 1 addition & 1 deletion
2
plugin/src/sbt-test/sbt-avro/basic/src/main/avro/logicalType.avsc
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.