nauphone / ServerAccess

A tool to provide easy and seamless access to multiple servers via SSH
GNU General Public License v2.0
18 stars 3 forks source link

Renew build system #49

Closed ahitrin closed 10 years ago

ahitrin commented 10 years ago

Currently, we use old and hard-to-manage ant script to build the application. Any change in build rules requires sophisticated xml hackery. Introducing external dependencies is also difficult (due to lack of dependency management in Ant). We should take a look on modern build systems in the Java world and evaluate the new possibilities/improvements they can give.

Possible candidates:

(Maven? No way! ;)

Acceptance criterii (what should the build system provide in order to be accepted):

ahitrin commented 10 years ago

The best way to do it fine is to migrate iteratively.

Step 1: create approval tests on file state

It could be done even with simple bash scripts:

touch clean.current
touch clean.shouldbe
touch java-build.current
...  # do the same for all interesting tasks
ant clean && tree > clean.shouldbe
ant java-build && tree > java-build.shouldbe
... # do the same for all interesting tasks

Step 2: reimplement task by task, use saved tests to verify that everything works the same

 $buildsystem clean && tree > clean.current
 dif=`diff clean.current clean.shouldbe | wc -l`; [ dif == 0 ] || echo fail

Automate this.

Step 3: remove ant completely

And also tests

ahitrin commented 10 years ago

N.B.: it's better to use different validators for different targets. For example, tree is enough for target clean, but for target like java-build we should use something like find . -name \*.class | xargs md5sum.

It's better to check files that are generated by the given target.

ahitrin commented 10 years ago

Currently, we have almost working Gradle build script. What's more we need to do:

Nice to have:

ahitrin commented 10 years ago

Bug found: resources and manifest are not placed into Gradle jar.

UPD: fixed by the following commit.

ahitrin commented 10 years ago

Enough for this ticket. Further changes will go in other tickets or without them.