Ninja-Squad / DbSetup

An API for populating a database in unit tests
http://dbsetup.ninja-squad.com/
212 stars 34 forks source link

Tweaks in build.gradle #16

Closed cexbrayat closed 12 years ago

cexbrayat commented 12 years ago

Attempt to fix DBS-1 and DBS-2 Default build now just compile the project (possible in JDK7) To release, the command is now

gradle -Prelease

Various typos fixed in javadoc .gitignore for IDEA

jnizet commented 12 years ago

I have incorporated some fixes (javadoc, formatting in build file, IntelliJ ignores, but some others are not desirable (Java 7, unneeded reformatting of imports, global imports, changes in the build file to please IDEA) . Could you please make a PR incorporating only the changes for Travis CI. It would be better to use a Ninja Squad account rather than a personal one, though.

Regarding the changes in the build file, I don't like the idea to introduce a property and complexity in the build file and the commands for all classical development tasks just to please IDEA. Gradle has a plugin to generate IDEA files. See http://gradle.org/docs/current/userguide/idea_plugin.html

cexbrayat commented 12 years ago

Ok i'll make a new PR with Travis. Login must be done with a github account though, so you can use mine or yours as you want...

I understand what you say for the build file, but at least typing 'gradle' in the command should not fail : when I want to contribute to a project I don't want to spend time figuring what section to comment in the build file, so I think it's mandatory to have a smaller build by default. But I agree there might be a better way to do it then having a property.

jnizet commented 12 years ago

Don't type gradle. Type gradlew. gradlew build is the complete build, with all the quality checks, tests and code coverage. This is how the standard Java plugin works.

If you just want to compile, gradlew compileJava can be used. If you just want to build the jar: gradlew jar. If you want to assemble all the artefacts: gradlew assemble. If you want to install in the local maven repo: gradlew install. If you want to run the tests: gradlew test. gradlew tasks [--all] tells you the available tasks. This task graph from the documentation of the Java plugin is also extremely useful.

I've fixed the problem with the sonatype properties. They were supposed to be checked only if the uploadArchives task was run, but I f*d up my tests. It's supposed to be working now, without commenting out anything in the build file.