everettwilson21 / protobuf-netbeans-plugin

Automatically exported from code.google.com/p/protobuf-netbeans-plugin
0 stars 0 forks source link

protobuf classes are not regenerated when a project is cleaned and build #16

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. open the attached project
2. change protobuf-java-2.0.3.jar (also attached) reference, so that it compiles
3. right-click on protobuftest and select "Clean and Build"

What is the expected output? What do you see instead?
I would expect that the protobuf clases are regenerated from the .proto files 
if you select "Clean and Build". However, this is not the case. Our project has 
hundreds of .proto files and it is very inconvenient to right-click all of them 
and regenerate them by hand. As a workaround I copy the generated protobuf 
classes somewhere else everytime I rebuild the project and copy them back after 
"Clean and Build" and build the project again.

What version of the product are you using? On what operating system?
Netbeans 6.9 with version 2.1.0 of the protobuf-netbeans-plugin on Windows 7. I 
tried this with Netbeans 6.9 on Debian SID with exactly the same result.

Original issue reported on code.google.com by michael....@googlemail.com on 3 Aug 2010 at 10:02

Attachments:

GoogleCodeExporter commented 8 years ago
It seems to me that everything is OK, but you haven't turn on the right 
options. See attached images. You should turn on "Generate java sources during 
pre-compile phase". It will generate the code and put it into "Generated 
Sources" dir. 

One more hint (image 2):
Instead of sending me 'protobuf-java-2.0.3' you can add 'protobuf-2.0' library 
to your project. 

Please confirm that above steps resolved your problem.   

Original comment by p...@google.com on 8 Aug 2010 at 5:23

Attachments:

GoogleCodeExporter commented 8 years ago
I turned on "Generate java sources during pre-compile phase", but that did not 
fix it. If I right-click the protobuf test project (the one I sent you) and 
select "Clean and Build", I still get an error message because the protobuf 
classes are not rebuild:

init:
deps-clean:
Updating property file: 
C:\Users\thaler\Documents\NetBeansProjects\protobuftest\build\built-clean.proper
ties
Deleting directory C:\Users\thaler\Documents\NetBeansProjects\protobuftest\build
clean:
init:
deps-jar:
Created dir: C:\Users\thaler\Documents\NetBeansProjects\protobuftest\build
Updating property file: 
C:\Users\thaler\Documents\NetBeansProjects\protobuftest\build\built-jar.properti
es
Created dir: 
C:\Users\thaler\Documents\NetBeansProjects\protobuftest\build\classes
Created dir: C:\Users\thaler\Documents\NetBeansProjects\protobuftest\build\empty
Compiling 1 source file to 
C:\Users\thaler\Documents\NetBeansProjects\protobuftest\build\classes
C:\Users\thaler\Documents\NetBeansProjects\protobuftest\src\protobuftest\Main.ja
va:3: package protobuftest.proto.Person does not exist
import protobuftest.proto.Person.PersonMessage;
C:\Users\thaler\Documents\NetBeansProjects\protobuftest\src\protobuftest\Main.ja
va:11: cannot find symbol
symbol  : class PersonMessage
location: class protobuftest.Main
        final PersonMessage person = PersonMessage.newBuilder().setName("Jack Jackson").setAge(22).build();
C:\Users\thaler\Documents\NetBeansProjects\protobuftest\src\protobuftest\Main.ja
va:11: cannot find symbol
symbol  : variable PersonMessage
location: class protobuftest.Main
        final PersonMessage person = PersonMessage.newBuilder().setName("Jack Jackson").setAge(22).build();
3 errors
C:\Users\thaler\Documents\NetBeansProjects\protobuftest\nbproject\build-impl.xml
:528: The following error occurred while executing this line:
C:\Users\thaler\Documents\NetBeansProjects\protobuftest\nbproject\build-impl.xml
:261: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 1 second)

Original comment by michael....@googlemail.com on 9 Aug 2010 at 8:08

Attachments:

GoogleCodeExporter commented 8 years ago
Any update on this? I get the same problem. I will get around this issue by 
having my script build the required sources post-clean but this should be made 
to work.

Original comment by david.ha...@gmail.com on 23 Sep 2011 at 6:27