hquxmu / ai-contest

Automatically exported from code.google.com/p/ai-contest
0 stars 0 forks source link

Patch for java package support #136

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
It's rather inconvenient to have all the files in a single folder, and, 
regarding java it is considered a bad practice.

I made a patch to solve this issue and tested it on my machine, works fine. My 
first piece of code in Python, though, so you may find it not exactly state-of 
the art ;)

P.S. helps some languages other than java, too!

Original issue reported on code.google.com by gvsmirno...@gmail.com on 12 Sep 2010 at 7:24

Attachments:

GoogleCodeExporter commented 8 years ago
This version had a security issue: nukeglob() did not go into subfolders. Fixed 
now

Original comment by gvsmirno...@gmail.com on 13 Sep 2010 at 5:08

Attachments:

GoogleCodeExporter commented 8 years ago
Related: Issue 102. (http://code.google.com/p/ai-contest/issues/detail?id=102)

Original comment by dar...@technofovea.com on 20 Sep 2010 at 4:58

GoogleCodeExporter commented 8 years ago
An even easier solution would be to change the "command" field in the languages 
database table from "java -jar MyBot.jar" to "java -cp . MyBot". This means no 
code changes and is trivial to roll back.

Original comment by camskin...@gmail.com on 21 Sep 2010 at 3:37

GoogleCodeExporter commented 8 years ago
camskinner, that is not a solution, since:
1. The .java files lying in subdirectories won't get compiled
2. the .jar or .class lying in subdirectories won't get deleted

Original comment by gvsmirno...@gmail.com on 26 Sep 2010 at 5:30

GoogleCodeExporter commented 8 years ago
The builder could perform the equivalent of:

$ find . -name *.jar | xargs rm
$ find . -name *.class | xargs rm
$ find . -name *.java | xargs javac
$ find . -name *.class | xargs jar -cvf MyBot.jar MyBot

Original comment by mattk...@gmail.com on 6 Oct 2010 at 11:15

GoogleCodeExporter commented 8 years ago
The change for this is live on the site now. If it isn't working, please let us 
know.

Original comment by jokeserver on 25 Nov 2010 at 5:43

GoogleCodeExporter commented 8 years ago

Original comment by jokeserver on 15 Jan 2011 at 8:25