Skip to content

Instantly share code, notes, and snippets.

@cb372
Last active December 15, 2015 20:00
Show Gist options
  • Save cb372/5315842 to your computer and use it in GitHub Desktop.
Save cb372/5315842 to your computer and use it in GitHub Desktop.
Gradle boilerplate generator
#!/bin/sh
content=$(cat <<EOF
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'eu.appsatori:gradle-fatjar-plugin:0.2-rc1'
}
}
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'maven'
apply plugin: 'fatjar'
group = "com.github.cb372"
version = "0.1"
repositories {
mavenCentral()
}
dependencies {
compile group: "commons-lang", name: "commons-lang", version: "3.1"
compile group: "com.google.guava", name: "guava", version: "14.0.1"
compile group: "com.google.code.findbugs", name: "jsr305", version: "1.3.9"
testCompile group: "junit", name: "junit", version: "4.11"
testCompile group: "org.mockito", name: "mockito-core", version: "1.8.1"
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives sourcesJar
}
EOF)
echo "$content" > build.gradle
content=$(cat <<EOF
.gradle
build
out
.idea
*.ipr
*.iml
*.iws
EOF)
echo "$content" >> .gitignore
mkdir -p src/main/java/com/github/cb372
mkdir -p src/main/resources/com/github/cb372
mkdir -p src/test/java/com/github/cb372
mkdir -p src/test/resources/com/github/cb372
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment