Skip to content

Commit

Permalink
Fix package reference in groovy test
Browse files Browse the repository at this point in the history
  • Loading branch information
Ranbir Kumar committed Jun 28, 2024
1 parent 8faa993 commit d2cf52a
Show file tree
Hide file tree
Showing 15 changed files with 38 additions and 38 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import java.util.zip.ZipFile

plugins {
id "com.github.davidmc24.gradle.plugin.avro" version "1.2.1"
id "org.apache.gradle.plugin.avro" version "1.2.1"
}

repositories {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "com.github.davidmc24.gradle.plugin.avro" version "1.2.1"
id "org.apache.gradle.plugin.avro" version "1.2.1"
}

repositories {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ repositories {
}

dependencies {
implementation 'com.github.davidmc24.gradle.plugin:gradle-avro-plugin:1.2.0'
implementation 'org.apache.gradle.plugin:gradle-avro-plugin:1.2.0'
implementation 'org.apache.avro:avro:1.11.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import org.gradle.api.Plugin;
import org.gradle.api.Project;
import com.github.davidmc24.gradle.plugin.avro.AvroPlugin;
import com.github.davidmc24.gradle.plugin.avro.AvroExtension;
import org.apache.avro.AvroPlugin;
import org.apache.avro.AvroExtension;

public class AvroConventionPlugin implements Plugin<Project> {
public void apply(Project project) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class AvroBasePluginFunctionalSpec extends FunctionalSpec {
def "can generate java files from json schema"() {
given:
buildFile << """
|tasks.register("generateAvroJava", com.github.davidmc24.gradle.plugin.avro.GenerateAvroJavaTask) {
|tasks.register("generateAvroJava", org.apache.avro.GenerateAvroJavaTask) {
| source file("src/main/avro")
| include("**/*.avsc")
| outputDir = file("build/generated-main-avro-java")
Expand All @@ -48,7 +48,7 @@ class AvroBasePluginFunctionalSpec extends FunctionalSpec {
def "can generate json schema files from json protocol"() {
given:
buildFile << """
|tasks.register("generateSchema", com.github.davidmc24.gradle.plugin.avro.GenerateAvroSchemaTask) {
|tasks.register("generateSchema", org.apache.avro.GenerateAvroSchemaTask) {
| source file("src/main/avro")
| include("**/*.avpr")
| outputDir = file("build/generated-main-avro-avsc")
Expand All @@ -70,11 +70,11 @@ class AvroBasePluginFunctionalSpec extends FunctionalSpec {
def "can generate json schema files from IDL"() {
given:
buildFile << """
|tasks.register("generateProtocol", com.github.davidmc24.gradle.plugin.avro.GenerateAvroProtocolTask) {
|tasks.register("generateProtocol", org.apache.avro.GenerateAvroProtocolTask) {
| source file("src/main/avro")
| outputDir = file("build/generated-avro-main-avpr")
|}
|tasks.register("generateSchema", com.github.davidmc24.gradle.plugin.avro.GenerateAvroSchemaTask) {
|tasks.register("generateSchema", org.apache.avro.GenerateAvroSchemaTask) {
| dependsOn generateProtocol
| source file("build/generated-avro-main-avpr")
| include("**/*.avpr")
Expand All @@ -99,12 +99,12 @@ class AvroBasePluginFunctionalSpec extends FunctionalSpec {
def "example of converting both IDL and json protocol simultaneously"() {
given:
buildFile << """
|tasks.register("generateProtocol", com.github.davidmc24.gradle.plugin.avro.GenerateAvroProtocolTask) {
|tasks.register("generateProtocol", org.apache.avro.GenerateAvroProtocolTask) {
| source file("src/main/avro")
| include("**/*.avdl")
| outputDir = file("build/generated-avro-main-avpr")
|}
|tasks.register("generateSchema", com.github.davidmc24.gradle.plugin.avro.GenerateAvroSchemaTask) {
|tasks.register("generateSchema", org.apache.avro.GenerateAvroSchemaTask) {
| dependsOn generateProtocol
| source file("src/main/avro")
| source file("build/generated-avro-main-avpr")
Expand Down Expand Up @@ -139,15 +139,15 @@ class AvroBasePluginFunctionalSpec extends FunctionalSpec {
buildFile << """
|avro {
| templateDirectory = "${templatesDir.toString().replace('\\', '\\\\')}/"
| additionalVelocityToolClasses = ['com.github.davidmc24.gradle.plugin.avro.test.custom.TimestampGenerator',
| 'com.github.davidmc24.gradle.plugin.avro.test.custom.CommentGenerator']
| additionalVelocityToolClasses = ['org.apache.avro.test.custom.TimestampGenerator',
| 'org.apache.avro.test.custom.CommentGenerator']
|}
|tasks.register("compileTools", JavaCompile) {
| source = sourceSets.main.java
| classpath = sourceSets.main.compileClasspath
| destinationDir = file("build/classes/java/main")
|}
|tasks.register("generateAvro", com.github.davidmc24.gradle.plugin.avro.GenerateAvroJavaTask) {
|tasks.register("generateAvro", org.apache.avro.GenerateAvroJavaTask) {
| dependsOn compileTools
| classpath = files("build/classes/java/main")
| source file("src/main/avro")
Expand All @@ -170,8 +170,8 @@ class AvroBasePluginFunctionalSpec extends FunctionalSpec {

private void copyAvroTools(String destDir) {
copyFile("src/test/java", destDir,
"com/github/davidmc24/gradle/plugin/avro/test/custom/CommentGenerator.java")
"org/apache/avro/test/custom/CommentGenerator.java")
copyFile("src/test/java", destDir,
"com/github/davidmc24/gradle/plugin/avro/test/custom/TimestampGenerator.java")
"org/apache/avro/test/custom/TimestampGenerator.java")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class BuildCacheSupportFunctionalSpec extends FunctionalSpec {
given: "a project is built once with build cache enabled"
copyResource("mail.avpr", avroDir)
buildFile << """
|tasks.register("generateSchema", com.github.davidmc24.gradle.plugin.avro.GenerateAvroSchemaTask) {
|tasks.register("generateSchema", org.apache.avro.GenerateAvroSchemaTask) {
| source file("src/main/avro")
| include("**/*.avpr")
| outputDir = file("build/generated-main-avro-avsc")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class EncodingFunctionalSpec extends FunctionalSpec {
|avro {
| outputCharacterEncoding = ${outputCharacterEncoding}
|}
|tasks.register("generateAvroJava", com.github.davidmc24.gradle.plugin.avro.GenerateAvroJavaTask) {
|tasks.register("generateAvroJava", org.apache.avro.GenerateAvroJavaTask) {
| source file("src/main/avro")
| include("**/*.avsc")
| outputDir = file("build/generated-main-avro-java")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ abstract class FunctionalSpec extends Specification {
}

protected void applyAvroPlugin() {
applyPlugin("com.github.davidmc24.gradle.plugin.avro")
applyPlugin("org.apache.gradle.plugin.avro")
}

protected void applyAvroBasePlugin() {
applyPlugin("com.github.davidmc24.gradle.plugin.avro-base")
applyPlugin("org.apache.gradle.plugin.avro-base")
}

protected void applyPlugin(String pluginId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class GenerateAvroProtocolTaskFunctionalSpec extends FunctionalSpec {
|dependencies {
| shared sharedIdlJar.outputs.files
|}
|tasks.register("generateProtocol", com.github.davidmc24.gradle.plugin.avro.GenerateAvroProtocolTask) {
|tasks.register("generateProtocol", org.apache.avro.GenerateAvroProtocolTask) {
| classpath = configurations.shared
| source file("src/dependent")
| outputDir = file("build/protocol")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class KotlinDSLCompatibilityFunctionalSpec extends FunctionalSpec {
kotlinBuildFile << """
|plugins {
| java
| id("com.github.davidmc24.gradle.plugin.avro")
| id("org.apache.gradle.plugin.avro")
|}
|repositories {
| mavenCentral()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ class OptionsFunctionalSpec extends FunctionalSpec {
| classpath files(["${templatesDir.parentFile.toURI()}"])
| }
|}
|apply plugin: "com.github.davidmc24.gradle.plugin.avro"
|apply plugin: "org.apache.gradle.plugin.avro"
|avro {
| templateDirectory = "/alternateTemplates/"
|}
Expand Down Expand Up @@ -284,11 +284,11 @@ class OptionsFunctionalSpec extends FunctionalSpec {
| classpath files(["${templatesDir.parentFile.toURI()}"])
| }
|}
|apply plugin: "com.github.davidmc24.gradle.plugin.avro"
|apply plugin: "org.apache.gradle.plugin.avro"
|avro {
| templateDirectory = "/alternateTemplates/"
| additionalVelocityToolClasses = ['com.github.davidmc24.gradle.plugin.avro.test.custom.TimestampGenerator',
| 'com.github.davidmc24.gradle.plugin.avro.test.custom.CommentGenerator']
| additionalVelocityToolClasses = ['org.apache.avro.test.custom.TimestampGenerator',
| 'org.apache.avro.test.custom.CommentGenerator']
|}
|""".stripMargin()

Expand Down Expand Up @@ -389,8 +389,8 @@ class OptionsFunctionalSpec extends FunctionalSpec {

private void copyAvroTools(String destDir) {
copyFile("src/test/java", destDir,
"com/github/davidmc24/gradle/plugin/avro/test/custom/CommentGenerator.java")
"org/apache/avro/test/custom/CommentGenerator.java")
copyFile("src/test/java", destDir,
"com/github/davidmc24/gradle/plugin/avro/test/custom/TimestampGenerator.java")
"org/apache/avro/test/custom/TimestampGenerator.java")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ResolveAvroDependenciesTaskFunctionalSpec extends FunctionalSpec {
given: "a build with the task declared"
applyAvroBasePlugin()
buildFile << """
|tasks.register("resolveAvroDependencies", com.github.davidmc24.gradle.plugin.avro.ResolveAvroDependenciesTask) {
|tasks.register("resolveAvroDependencies", org.apache.avro.ResolveAvroDependenciesTask) {
| source file("src/avro/normalized")
| outputDir = file("build/avro/resolved")
|}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class SchemaResolverSpec extends Specification {
def "Duplicate record definition succeeds if definition identical"() {
given:
def resourceNames = ["Person.avsc", "Fish.avsc"]
def files = resourceNames.collect { new File("src/test/resources/com/github/davidmc24/gradle/plugin/avro/duplicate/${it}") }
def files = resourceNames.collect { new File("org/apache/avro/duplicate/${it}") }
when:
def processingState = resolver.resolve(files)
Expand All @@ -123,7 +123,7 @@ class SchemaResolverSpec extends Specification {
def "Duplicate enum definition succeeds if definition identical"() {
given:
def resourceNames = ["Person.avsc", "Cat.avsc"]
def files = resourceNames.collect { new File("src/test/resources/com/github/davidmc24/gradle/plugin/avro/duplicate/${it}") }
def files = resourceNames.collect { new File("org/apache/avro/duplicate/${it}") }

when:
def processingState = resolver.resolve(files)
Expand All @@ -137,7 +137,7 @@ class SchemaResolverSpec extends Specification {
def "Duplicate fixed definition succeeds if definition identical"() {
given:
def resourceNames = ["ContainsFixed1.avsc", "ContainsFixed2.avsc"]
def files = resourceNames.collect { new File("src/test/resources/com/github/davidmc24/gradle/plugin/avro/duplicate/${it}") }
def files = resourceNames.collect { new File("src/test/resources/org/apache/avro/duplicate/${it}") }

when:
def processingState = resolver.resolve(files)
Expand All @@ -151,7 +151,7 @@ class SchemaResolverSpec extends Specification {
def "Duplicate record definition fails if definition differs"() {
given:
def resourceNames = ["Person.avsc", "Spider.avsc"]
def files = resourceNames.collect { new File("src/test/resources/com/github/davidmc24/gradle/plugin/avro/duplicate/${it}") }
def files = resourceNames.collect { new File("src/test/resources/org/apache/avro/duplicate/${it}") }

when:
resolver.resolve(files)
Expand All @@ -164,7 +164,7 @@ class SchemaResolverSpec extends Specification {
def "Duplicate enum definition fails if definition differs"() {
given:
def resourceNames = ["Dog.avsc", "Person.avsc"]
def files = resourceNames.collect { new File("src/test/resources/com/github/davidmc24/gradle/plugin/avro/duplicate/${it}") }
def files = resourceNames.collect { new File("src/test/resources/org/apache/avro/duplicate/${it}") }

when:
resolver.resolve(files)
Expand All @@ -177,7 +177,7 @@ class SchemaResolverSpec extends Specification {
def "Duplicate fixed definition fails if definition differs"() {
given:
def resourceNames = ["ContainsFixed1.avsc", "ContainsFixed3.avsc"]
def files = resourceNames.collect { new File("src/test/resources/com/github/davidmc24/gradle/plugin/avro/duplicate/${it}") }
def files = resourceNames.collect { new File("src/test/resources/org/apache/avro/duplicate/${it}") }

when:
resolver.resolve(files)
Expand All @@ -189,7 +189,7 @@ class SchemaResolverSpec extends Specification {

def "Duplicate record definition in single file fails with clear error"() {
given:
def file = new File("src/test/resources/com/github/davidmc24/gradle/plugin/avro/duplicate/duplicateInSingleFile.avsc")
def file = new File("src/test/resources/org/apache/avro/duplicate/duplicateInSingleFile.avsc")

when:
resolver.resolve([file])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id("idea")
id("org.apache.gradle.plugin.avro") version ("1.2.0")
// id "com.github.davidmc24.gradle.plugin.avro" version "1.2.1-SNAPSHOT"
// id "org.apache.gradle.plugin.avro" version "1.2.1-SNAPSHOT"
}

repositories {
Expand Down
2 changes: 1 addition & 1 deletion lang/java/gradle-plugin/test-project/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id "idea"
id "org.apache.gradle.plugin.avro" version "1.2.0"
// id "com.github.davidmc24.gradle.plugin.avro" version "1.2.1-SNAPSHOT"
// id "org.apache.gradle.plugin.avro" version "1.2.1-SNAPSHOT"
}

repositories {
Expand Down

0 comments on commit d2cf52a

Please sign in to comment.