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

[#4098] Make "play javadoc" fail if javadoc fails #1322

Merged
merged 2 commits into from
Jan 2, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[#4098] Make 'play javadoc' fail when javadoc fails
David Costanzo committed Dec 16, 2019
commit 43f7d0854b3c50e255be90ebd80808c8d7e2f1bc
15 changes: 11 additions & 4 deletions framework/pym/play/commands/javadoc.py
Original file line number Diff line number Diff line change
@@ -39,14 +39,21 @@ def execute(**kargs):
javadoc_cmd = [javadoc_path, '@'+os.path.join(outdir,'javadocOptions'), '@'+os.path.join(outdir,'javadocFiles')]

print "Generating Javadoc in " + outdir + "..."
subprocess.call(javadoc_cmd, env=os.environ, stdout=sout, stderr=serr)
print "Done! You can open " + os.path.join(outdir, 'overview-tree.html') + " in your browser."
return_code = subprocess.call(javadoc_cmd, env=os.environ, stdout=sout, stderr=serr)

# Remove configuration file
os.remove(os.path.join(outdir , 'javadocOptions'))
os.remove(os.path.join(outdir , 'javadocFiles'))



# Display the status
if return_code != 0:
print "Unable to create Javadocs. See " + os.path.join(app.log_path(), 'javadoc.err') + " for errors."
sys.exit(return_code)

print "Done! You can open " + os.path.join(outdir, 'overview-tree.html') + " in your browser."



def defineJavadocOptions(app, outdir, args):
f = open(os.path.join(outdir , 'javadocOptions'), 'w')
f.write(' '.join(['-classpath', app.cp_args(), '-d', outdir, '-encoding', 'UTF-8', '-charset', 'UTF-8']))