-
-
Save cushon/0ffbe4f2a11141106695 to your computer and use it in GitHub Desktop.
bazel / source generating annotation processors
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
java_plugin( | |
name = "auto_plugin", | |
processor_class = "com.google.auto.value.processor.AutoValueProcessor", | |
deps = ["@auto_value//jar"], | |
) | |
java_library( | |
name = "auto", | |
exported_plugins = [":auto_plugin"], | |
exports = ["@auto_value//jar"], | |
) | |
java_library( | |
name = "test", | |
srcs = ["Test.java"], | |
deps = [":auto"], | |
) |
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
import com.google.auto.value.AutoValue; | |
@AutoValue | |
public abstract class Test { | |
public abstract String message(); | |
public static Test create(String message) { | |
return new AutoValue_Test(message); | |
} | |
} |
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
maven_jar( | |
name = "auto_value", | |
artifact = "com.google.auto.value:auto-value:1.2", | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment