summaryrefslogtreecommitdiff
path: root/src/google/protobuf/compiler/java/java_lite_main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/compiler/java/java_lite_main.cc')
-rw-r--r--src/google/protobuf/compiler/java/java_lite_main.cc34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/google/protobuf/compiler/java/java_lite_main.cc b/src/google/protobuf/compiler/java/java_lite_main.cc
new file mode 100644
index 00000000..ffb4c2d5
--- /dev/null
+++ b/src/google/protobuf/compiler/java/java_lite_main.cc
@@ -0,0 +1,34 @@
+#include <google/protobuf/compiler/code_generator.h>
+#include <google/protobuf/compiler/java/java_generator.h>
+#include <google/protobuf/compiler/plugin.h>
+
+namespace google {
+namespace protobuf {
+namespace compiler {
+namespace java {
+
+class JavaLiteGenerator : public CodeGenerator {
+ public:
+ JavaLiteGenerator() {}
+ ~JavaLiteGenerator() {}
+ bool Generate(const FileDescriptor* file,
+ const string& parameter,
+ GeneratorContext* context,
+ string* error) const {
+ // Only pass 'lite' as the generator parameter.
+ return generator_.Generate(file, "lite", context, error);
+ }
+ private:
+ JavaGenerator generator_;
+ GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(JavaLiteGenerator);
+};
+
+} // namespace java
+} // namespace compiler
+} // namespace protobuf
+} // namespace google
+
+int main(int argc, char* argv[]) {
+ google::protobuf::compiler::java::JavaLiteGenerator generator;
+ return google::protobuf::compiler::PluginMain(argc, argv, &generator);
+}