-
Notifications
You must be signed in to change notification settings - Fork 1
Build
sudo apt install openjdk-8-jdk mercurial ant empty-expect
git clone https://github.com/cayhorstmann/codecheck
cd codecheck/checker
ant jar
This makes a file codecheck.jar
.
To test that it works, run
./codecheck -t ../samples/java/test4
You should get a text report that awards 2/2 points.
Make a subdirectory checker/lib
and place into it junit.jar
and hamcrest-core.jar
from the JUnit download page
Visit the Checkstyle download page, download and uncompress the Checkstyle binary distribution, and put the file checkstyle-x.y-all.jar
into the subdirectory checker/lib
.
It is best if you have a code signing certificate from Comodo, Thawte, Verisign, or another CA whose root key is in each JVM. If you do, put the certificate in a Java keystore codecheck.jks
with alias codecheck and store password and key password both set to secret
, following the directions of the vendor.
If not, make your own private and public key.
Run
cd checker
keytool -genkeypair -keystore codecheck.jks -alias codecheck
chmod 400 codecheck.jks
keytool -export -keystore codecheck.jks -alias codecheck -file codecheck-public.cer
keytool -importcert -keystore codecheck-public.jks -alias codecheck -file codecheck-public.cer
rm codecheck-public.cer
When prompted for a password, use secret
.
You need to keep codecheck.jks
safe. Note that the server upload script copies it to the /opt/codecheck
directory of the server. Give codecheck-public.jks
to anyone who wants to verify files. You can safely put this file on a public web site.
If you use a key signed by a CA, then anyone can verify the signed zips from students by running
jarsigner -verify Problem.signed.zip
If not, the verifier needs a copy of the public key store, and then runs
jarsigner -keystore codecheck-public.jks -storepass secret -verify Problem.signed.zip