-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding config option to disable utf8 encoding
- Loading branch information
1 parent
997baf1
commit 397aefa
Showing
14 changed files
with
558 additions
and
61 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
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
133 changes: 133 additions & 0 deletions
133
avro-builder/tests/codegen-no-utf8-encoding/build.gradle
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,133 @@ | ||
/* | ||
* Copyright 2022 LinkedIn Corp. | ||
* Licensed under the BSD 2-Clause License (the "License"). | ||
* See License in the project root for license information. | ||
*/ | ||
|
||
plugins { | ||
id "java-library" | ||
} | ||
|
||
configurations { | ||
codegen | ||
} | ||
|
||
sourceSets { | ||
main { | ||
java { | ||
srcDir 'src/main/java' | ||
srcDir "$buildDir/generated/sources/avro/java/main" | ||
} | ||
resources { | ||
srcDirs = [ | ||
"src/main/avro" | ||
] | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
codegen project(":avro-builder:builder") | ||
} | ||
|
||
task runOwnCodegen { | ||
description = 'generate specific classes using own codegen utility' | ||
|
||
dependsOn configurations.codegen | ||
|
||
doLast { | ||
javaexec { | ||
classpath configurations.codegen | ||
main = 'com.linkedin.avroutil1.builder.SchemaBuilder' | ||
args = [ | ||
"--input", "$projectDir/src/main/avro", | ||
"--output", "$buildDir/generated/sources/avro/java/main", | ||
"--generator", "AVRO_UTIL", | ||
"--stringRepresentation", "CharSequence", | ||
"--methodStringRepresentation", "CharSequence", | ||
"--enableUtf8Encoding", "false" | ||
] | ||
} | ||
} | ||
} | ||
|
||
compileJava.dependsOn runOwnCodegen | ||
|
||
dependencies { | ||
codegen project(":avro-builder:builder") | ||
|
||
implementation("org.apache.avro:avro:1.4.1") { | ||
exclude group: "org.mortbay.jetty" | ||
exclude group: "org.apache.velocity" | ||
exclude group: "commons-lang" | ||
exclude group: "org.jboss.netty" | ||
exclude group: "com.thoughtworks.paranamer", module: "paranamer-ant" | ||
} | ||
//required because generated code depends on the helper | ||
implementation project(":helper:helper") | ||
} | ||
|
||
// | ||
// plugins { | ||
// id "java-library" | ||
// } | ||
// | ||
// configurations { | ||
// codegen | ||
// } | ||
// | ||
// sourceSets { | ||
// main { | ||
// java { | ||
// srcDir 'src/main/java' | ||
// srcDir "$buildDir/generated/sources/avro/java/main" | ||
// } | ||
// resources { | ||
// srcDirs = [ | ||
// "src/main/avro" | ||
// ] | ||
// } | ||
// } | ||
// } | ||
// | ||
// dependencies { | ||
// codegen project(":avro-builder:builder") | ||
// } | ||
// | ||
// task runOwnCodegen { | ||
// description = 'generate specific classes using own codegen utility' | ||
// | ||
// dependsOn configurations.codegen | ||
// | ||
// doLast { | ||
// javaexec { | ||
// classpath configurations.codegen | ||
// main = 'com.linkedin.avroutil1.builder.SchemaBuilder' | ||
// args = [ | ||
// "--input", "$projectDir/src/main/avro", | ||
// "--output", "$buildDir/generated/sources/avro/java/main", | ||
// "--generator", "AVRO_UTIL", | ||
// "--stringRepresentation", "CharSequence", | ||
// "--methodStringRepresentation", "CharSequence", | ||
// "--enableUtf8Encoding", "false" | ||
// ] | ||
// } | ||
// } | ||
// } | ||
// | ||
// compileJava.dependsOn runOwnCodegen | ||
// | ||
// dependencies { | ||
// codegen project(":avro-builder:builder") | ||
// | ||
// implementation ("org.apache.avro:avro:1.4.1") { | ||
// exclude group: "org.mortbay.jetty" | ||
// exclude group: "org.apache.velocity" | ||
// exclude group: "commons-lang" | ||
// exclude group: "org.jboss.netty" | ||
// exclude group: "com.thoughtworks.paranamer", module: "paranamer-ant" | ||
// } | ||
// //required because generated code depends on the helper | ||
// implementation project(":helper:helper") | ||
// } | ||
//} |
15 changes: 15 additions & 0 deletions
15
...ilder/tests/codegen-no-utf8-encoding/src/main/avro/charseqmethod/ArrayOfStringRecord.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"type": "record", | ||
"namespace": "noutf8encoding", | ||
"name": "ArrayOfStringRecord", | ||
"doc": "Array of String Record", | ||
"fields": [ | ||
{ | ||
"name": "arOfRec", | ||
"type": { | ||
"type":"array", | ||
"items": "string" | ||
} | ||
} | ||
] | ||
} |
23 changes: 23 additions & 0 deletions
23
...builder/tests/codegen-no-utf8-encoding/src/main/avro/charseqmethod/HasNoSimpleString.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"type": "record", | ||
"namespace": "noutf8encoding", | ||
"name": "HasNoSimpleString", | ||
"fields": [ | ||
{ | ||
"name": "one", | ||
"type": "float" | ||
}, | ||
{ | ||
"name": "two", | ||
"type": ["string"] | ||
}, | ||
{ | ||
"name": "three", | ||
"type": "int" | ||
}, | ||
{ | ||
"name": "four", | ||
"type": "boolean" | ||
} | ||
] | ||
} |
Oops, something went wrong.