Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to run the sample code? #163

Closed
fzyzcjy opened this issue Dec 23, 2020 · 4 comments
Closed

How to run the sample code? #163

fzyzcjy opened this issue Dec 23, 2020 · 4 comments

Comments

@fzyzcjy
Copy link

fzyzcjy commented Dec 23, 2020

Hi I am not very familiar with java compilation. Thus I wonder how should I run the code in sample dir? If I directly compile it, java complains that many classes are not defined. I also tried things like javac -cp archive-patcher-1.0.jar ./SamplePatchGenerator.java && java SamplePatchGenerator (with jar downloaded and put in the right location), but still no luck. Thanks!

@fzyzcjy
Copy link
Author

fzyzcjy commented Dec 23, 2020

OK I get it:

 javac -cp archive-patcher-1.0.jar:. ./SamplePatchGenerator.java && java -cp archive-patcher-1.0.jar:. SamplePatchGenerator

@fzyzcjy fzyzcjy closed this as completed Dec 23, 2020
@andrewhayden
Copy link
Contributor

That's one way to do it, certainly, and quite reasonable. The sample code is just here to show you how to write a patch generator and a patch applier. More fully:

  • If you execute "gradle build" in the "generator" directory you will build the library necessary for a patch generator into generator/build/libs/generator.jar
  • If you execute "gradle build" in the "applier" directory you will build the library necessary for a patch applier into applier/build/libs/applier.jar
  • If you execute "gradle build" in the "common" directory you will built the library needed for both generator and applier (shared code)

To compile and/or run the sample patch generator you would need the "common" and "generator" libraries in your classpath. To compile and/or run the sample patch applier you would need the "common" and "applier" libraries in your classpath. There's no need to deploy the "applier" code on a system that only generates patches (e.g., a server), and no need to deploy the "generator" code on a system that only applies patches (e.g., a client).

@fzyzcjy
Copy link
Author

fzyzcjy commented Dec 23, 2020

Thank you very much for the detailed answer!

@andrewhayden
Copy link
Contributor

Sure. Please see also #16.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants