Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kirang89/play-gradle
Some Gradle scripts for Play! Framework
https://github.com/kirang89/play-gradle
Last synced: 7 days ago
JSON representation
Some Gradle scripts for Play! Framework
- Host: GitHub
- URL: https://github.com/kirang89/play-gradle
- Owner: kirang89
- Created: 2012-07-17T19:46:11.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-08-01T00:46:37.000Z (over 12 years ago)
- Last Synced: 2024-04-16T18:23:09.472Z (7 months ago)
- Language: JavaScript
- Size: 375 KB
- Stars: 12
- Watchers: 6
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#Gradle Scripts for Play! Framework Application
This repo contains a ````build.gradle```` file that contains some useful Gradle snippets to be used for building and packaging a Play! Application.
##build.gradle
**Defining Repositories**
````groovy
buildscript{
repositories{
mavenLocal()
mavenCentral()
}
}````
**Taking backup of the public folder**````groovy
task backupResources {
}task backupJS(type:Copy){
from ('public/javascripts') {
include '*.js'
}
into 'resources/javascripts'
}task backupCSS(type:Copy){
from ('public/stylesheets') {
include '*.css'
}
into 'resources/stylesheets'
}
````**Script for Zipping the backup file**
````groovy
task zip(type:Zip){
baseName = projectDir.name
version = zipVersionfrom("resources/") {
into 'resources'
}from('app/controllers/'){
into 'controllers'
}from('app/views/'){
exclude 'errors'
into 'views'
}from('conf/'){
into 'conf'
}
}
````**Combining Javascript Files**
````groovy
combineJs {
source = file(jsSrcDir)
include "*.js"
exclude "*.min.js"
dest = file("public/javascripts/all.js")
}
````
**Minifying Javascript Files**
````groovy
minifyJs {
source = combineJs
println source
dest = file("public/javascripts/all.min.js")
closure{
compilationLevel = 'SIMPLE_OPTIMIZATIONS'
warningLevel = 'QUIET'
}
}
````
**Single command to build your Play! project**
````groovy
task buildProject(type: GradleBuild){
//buildFile = 'build.gradle'
//dir = 'app/controllers/Application.java'
tasks = ['playClean','playStartApp']
}
````