-
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.
Update cache to include records to recompile
- Loading branch information
1 parent
195850a
commit cb6b72d
Showing
3 changed files
with
82 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "Record", | ||
"namespace": "com.github.sbt.avro.test", | ||
"type": "record", | ||
"fields": [ | ||
{ | ||
"name": "value", | ||
"type": "string" | ||
} | ||
] | ||
} |
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,5 +1,28 @@ | ||
> compile | ||
> avroGenerate | ||
$ exists target/scala-2.13/src_managed/compiled_avro/main/org/apache/avro/specific/TestRecordWithLogicalTypes.java | ||
|
||
# reference file created after 1st generation | ||
$ touch target/reference.txt | ||
|
||
# cache should not recompile | ||
> avroGenerate | ||
$ newer target/reference.txt target/scala-2.13/src_managed/compiled_avro/main/org/apache/avro/specific/TestRecordWithLogicalTypes.java | ||
|
||
# regenerate after clean | ||
> clean | ||
> avroGenerate | ||
$exists target/scala-2.13/src_managed/compiled_avro/main/org/apache/avro/specific/TestRecordWithLogicalTypes.java | ||
|
||
# add new source file should re-compile | ||
$ copy-file record.avsc src/main/avro/record.avsc | ||
> avroGenerate | ||
$ exists target/scala-2.13/src_managed/compiled_avro/main/com/github/sbt/avro/test/Record.java | ||
$ exists target/scala-2.13/src_managed/compiled_avro/main/org/apache/avro/specific/TestRecordWithLogicalTypes.java | ||
-$ exec grep BigDecimal target/scala-2.13/src_managed/compiled_avro/main/org/apache/avro/specific/TestRecordWithLogicalTypes.java | ||
-$ exec grep CharSequence target/scala-2.13/src_managed/compiled_avro/main/org/apache/avro/specific/TestRecordWithLogicalTypes.java | ||
|
||
# update reference file | ||
$ touch target/reference.txt | ||
|
||
# cache should not recompile | ||
> avroGenerate | ||
$ newer target/reference.txt target/scala-2.13/src_managed/compiled_avro/main/com/github/sbt/avro/test/Record.java | ||
$ newer target/reference.txt target/scala-2.13/src_managed/compiled_avro/main/org/apache/avro/specific/TestRecordWithLogicalTypes.java |