blob: b75015a3067d741443f6ef329acf81aafaa47bee [file] [log] [blame]
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* See the License for the specific language governing permissions and
* limitations under the License.
* Apache S4 Application Build File
* Use this script to buils and package S4 apps.
* Run 'gradle install' on the s4 project to publish to your local maven repo.
* TODO: This should probably be distributed as an s4 plugin for Gradle.
* TODO: There seem to be to be similarities with the war and jetty plugins. (war -> s4r, jetty -> s4Run).
* We should make it easy to test the app from this script by a running a test task that starts and stops
* an s4 server. See:
* This is an interesting discussion:
project.ext["s4Version"] = '0.6.0-incubating'
description = 'Apache S4 App'
project.ext["archivesBaseName"] = "$"
project.ext["distRootFolder"] = "$archivesBaseName-${-> version}"
// Append the suffix 'SNAPSHOT' when the build is not for release.
//version = new Version(major: 0, minor: 0, bugfix: 0, isRelease: false)
group = 'org.apache.s4'
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
/* Set Java version. */
sourceCompatibility = 1.6
targetCompatibility = 1.6
repositories {
maven { url '' }
maven { url '' }
maven { url '' }
/* Add lib dir as a repo. Some jar files that are not available
in a public repo are distributed in the lib dir. */
flatDir name: 'libDir', dirs: "$rootDir/lib"
/* All project libraries must be defined here. */
project.ext["libraries"] = [
s4_base: 'org.apache.s4:s4-base:0.6.0-incubating',
s4_comm: 'org.apache.s4:s4-comm:0.6.0-incubating',
dependencies {
compile (libraries.s4_base)
compile (libraries.s4_comm)
configurations.all {
exclude group: 'com.sun.jdmk', module: 'jmxtools'
exclude group: 'com.sun.jmx', module: 'jmxri'
exclude group: 'javax.jms', module: 'jms'
exclude group: 'javax.mail', module: 'mail'
/* Set the manifest attributes for the S4 archive here.
* TODO: separate custom properties from std ones and set custom properties at the top of the build script.
provider: 'gradle',
'Implementation-Url': '',
'Implementation-Version': version,
'Implementation-Vendor': 'Apache S4',
'Implementation-Vendor-Id': 'custom modules',
'S4-Version': s4Version
project.ext["appDependencies"] = ( configurations.compile )
// external dependencies will be available in the /lib directory of the s4r
task copyDependenciesToLib(type: Copy) {
into project.libsDir.path+"/lib"
from configurations.runtime
// app jar will be available from the /app directory of the s4r
task buildProjectJar() {
dependsOn jar {
destinationDir file(project.libsDir.path + "/app")
from sourceSets.main.output