nhatminhle / cofoja

Contracts for Java
GNU Lesser General Public License v3.0
151 stars 18 forks source link

Builds rely on ${java.class.path} #18

Closed nhatminhle closed 9 years ago

nhatminhle commented 9 years ago

From teodoz...@gmail.com on February 09, 2011 13:48:56

What steps will reproduce the problem? 1. Compilation on Ubuntu 10.10 with all libasm libraries and sun java What is the expected output? What do you see instead? Package does not exists compilation error What version of the product are you using? On what operating system? Ubuntu 10.10 with all libasm (1,2,3) libraries and sun java Please provide any additional information below. Manually adding lib to classpath in build helps but this not universal solution.

Attachment: build.xml_diff

Original issue: http://code.google.com/p/cofoja/issues/detail?id=13

nhatminhle commented 9 years ago

From nhat.min...@gmail.com on February 09, 2011 15:33:48

The current build file assumes that you have the proper libraries in the class path when you try to compile. We could also provide variables to bind to proper paths, which may be a bit cleaner. Ant is not an auto-configuration tool anyway. At the moment, you should just compile witht he proper environment variable set:

CLASSPATH=/usr/share/... ant

In no case should we hard-code these values in the build file, though. The next version of the build script, which I'm working on along with Maven support, comes with variables, so you can just type instead, if you wish:

ant -Dasmjar=/usr/share/...

Though I'm not convinced that is much of an improvement...

nhatminhle commented 9 years ago

From nhat.min...@gmail.com on February 11, 2011 07:28:13

The following patch restructures the build.xml script and allows you to override the path to the dependencies in a property file called 'local.properties' at the root of the project. It also comes with a 'default.properties' file which contains all the user-settable properties with their descriptions. The patch is awaiting review, but feel free to try it out and make suggestions.

Status: Started
Owner: nhat.minh.le

Attachment: 0001-New-build-script.patch

nhatminhle commented 9 years ago

From teodoz...@gmail.com on February 11, 2011 09:09:49

Now user knows that needs to make path and I think this is right way for ant. Thanks.

I attach maven template that makes jar only (run with mvn install) maybe will help.

I didn't have time to test cofoja itself but weekend is coming.

Attachment: pom.xml

nhatminhle commented 9 years ago

From nhat.min...@gmail.com on February 11, 2011 10:58:49

We already have a POM file discussion going on in issue 11 , and I've provided another uncommitted patch in that thread, which is a bit more complete, but thanks anyway. :)

I know there are a few patches floating around (at least three on this bug tracker alone) and it's a bit difficult for outsiders to keep track; you may wonder why they're not committed yet; here's why: the official policy of the project, which we have inherited from Google, is systematic review. And since we're a bit shorthanded at the moment with David AFK, it takes time for changes to make it into the repo.

nhatminhle commented 9 years ago

From nhat.min...@gmail.com on February 23, 2011 02:39:43

Committed the new build system as r78 . Paths to JAR files now have to be set explicitly and default to lib/.jar, as per Ant guidelines.

Status: Fixed