Skip to content

Instantly share code, notes, and snippets.

@shrikant0013
Last active December 7, 2016 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shrikant0013/c843664915096c0033ea217c961ad756 to your computer and use it in GitHub Desktop.
Save shrikant0013/c843664915096c0033ea217c961ad756 to your computer and use it in GitHub Desktop.
How to setup java gradle project
-- With idea
-- Groovy
-- Spock testing framework
Prereqs:
gradle
Use sdkman to get gradle
http://sdkman.io/index.html
-- curl -s "https://get.sdkman.io" | bash
sdk install gradle
java
- To install java on macOS download dmg from here and install
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Steps:
1) In idea select 'empty project'
2) Select project sdk '1.8'
In intellij go to File -> Project Structure -> Project Settings -> Project -> Project SDK -> 1.8
3) Close
4) from terminal run:
gradle init --type java-library --test-framework spock
5) Edit build.gradle file and add -> apply plugin: 'idea'
6) from terminal run:
./gradlew idea
7) git add . ;
8) git add --force gradle/wrapper/gradle-wrapper.jar
git commit -m "initial commit" ;
Note--
To include groovy/spoc in existing project
-- in build.gradle -> apply plugin 'groovy' (** Note single quotes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment