Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
0c011c4c
Commit
0c011c4c
authored
Jul 15, 2016
by
Jisi Liu
Committed by
GitHub
Jul 15, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1793 from pherl/javalite
Add a javalite plugin.
parents
10a8fb4e
b702a16f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
1 deletion
+38
-1
Makefile.am
src/Makefile.am
+4
-1
java_lite_main.cc
src/google/protobuf/compiler/java/java_lite_main.cc
+34
-0
No files found.
src/Makefile.am
View file @
0c011c4c
...
...
@@ -472,9 +472,11 @@ libprotoc_la_SOURCES = \
google/protobuf/compiler/csharp/csharp_wrapper_field.cc
\
google/protobuf/compiler/csharp/csharp_wrapper_field.h
bin_PROGRAMS
=
protoc
bin_PROGRAMS
=
protoc
protoc-gen-javalite
protoc_LDADD
=
$(PTHREAD_LIBS)
libprotobuf.la libprotoc.la
protoc_SOURCES
=
google/protobuf/compiler/main.cc
protoc_gen_javalite_LDADD
=
$(PTHREAD_LIBS)
libprotobuf.la libprotoc.la
protoc_gen_javalite_SOURCES
=
google/protobuf/compiler/java/java_lite_main.cc
# Tests ==============================================================
...
...
@@ -677,6 +679,7 @@ COMMON_TEST_SOURCES = \
check_PROGRAMS
=
protoc protobuf-test protobuf-lazy-descriptor-test
\
protobuf-lite-test test_plugin protobuf-lite-arena-test
\
protoc-gen-javalite
\
$(GZCHECKPROGRAMS)
protobuf_test_LDADD
=
$(PTHREAD_LIBS)
libprotobuf.la libprotoc.la
\
../gmock/gtest/lib/libgtest.la
\
...
...
src/google/protobuf/compiler/java/java_lite_main.cc
0 → 100644
View file @
0c011c4c
#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
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment