Skip to content

Gradle #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
7a3c667
server: coded server-package
LeanderK May 21, 2016
48117c0
server: further progress, added file handlers + exception handlers. R…
LeanderK May 26, 2016
bdfc85c
server: improved HandlerHelper
LeanderK May 26, 2016
44d24bd
addon: finished router code for Addon implementation
LeanderK May 26, 2016
3449643
server: further progress on the server-package
LeanderK May 27, 2016
791d286
server: coded SDKRouter
LeanderK May 27, 2016
290eb43
resources: added needed resources for the SDKRouter
LeanderK May 27, 2016
910a8ae
pom: added Freemarker as dependency
LeanderK May 27, 2016
ecaf4ed
server: added PropertiesRouter
LeanderK May 27, 2016
e1c180f
addon: initialized router with PropertiesRouter
LeanderK May 27, 2016
09e0e69
sdk: added AddonImpl since it now has a router...but does nothing else
LeanderK May 27, 2016
71255aa
sdk: fixed AddOnImpl
LeanderK May 27, 2016
255b5e7
resource-user: improved TODO
LeanderK May 27, 2016
95a3d37
pom: updated to new Izou-version
LeanderK May 27, 2016
67e5a1f
context: updated context to new api
LeanderK May 27, 2016
8268286
server: now implemented Handler-helper right
LeanderK May 27, 2016
0e407ca
pom: update to new version
LeanderK May 29, 2016
4a483a6
server: added http options
LeanderK May 31, 2016
b123b70
pom: new izou-version
LeanderK May 31, 2016
4a19603
addon: deleted unnecessary imports
LeanderK May 31, 2016
559d96d
sdk: fixed bugs
LeanderK Jun 2, 2016
d603fa5
sdk: fixed bugs
LeanderK Jun 7, 2016
147e57e
gradle: added gradle support
LeanderK Jun 7, 2016
9626652
travis: added travis file
LeanderK Jun 7, 2016
7a9df97
gradle: fixed build script
LeanderK Jun 8, 2016
3f6d3ff
server: fixed bugs
LeanderK Jun 8, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,4 @@ local.properties
.texlipse


/ci/local/
22 changes: 22 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
language: java
jdk:
- oraclejdk8
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
deploy:
provider: script
script: ci/deploy.sh
on:
branch: master
branches:
except:
- gh-pages
dd:
- openssl aes-256-cbc -K $encrypted_c0073d2c294f_key -iv $encrypted_c0073d2c294f_iv
-in ci/gradle.properties.enc -out gradle.properties -d
- openssl aes-256-cbc -K $encrypted_a724ed19665a_key -iv $encrypted_a724ed19665a_iv
-in ci/secring.gpg.enc -out ci/secring.gpg -d
136 changes: 136 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
import java.util.stream.Collectors

group 'org.intellimate.izou'
version '0.19.0'

apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'com.bmuschko.nexus'
apply plugin: 'distribution'
apply plugin: 'io.codearte.nexus-staging'

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1'
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.5.3"
}
}

sourceCompatibility = 1.8
targetCompatibility = 1.8

mainClassName = 'org.intellimate.izou.Main'

repositories {
mavenCentral()
mavenLocal()
}

dependencies {
compile 'org.intellimate.izou:izou:1.16.5'
compile 'commons-lang:commons-lang:2.+'
compile 'org.freemarker:freemarker:2.3.24-incubating'
testCompile 'org.mockito:mockito-core:1.+'
testCompile group: 'junit', name: 'junit', version: '4.11'
}



def String projectName = 'IzouSDK';
def String pluginClass = 'org.intellimate.izou.sdk.ZipFileManagerImpl';
def String provider = 'intellimate';
def List<String> dependencies = [];
def String serverId = '1';
def String repoURL = 'https://github.com/intellimate/IzouSDK';

jar {
baseName = projectName
manifest {
attributes 'Plugin-Class' : pluginClass,
'Plugin-Id' : group + "." + project.name,
'Plugin-Version' : project.version,
'Plugin-Provider' : provider,
'Plugin-Dependencies' : dependencies.stream().collect(Collectors.joining(",")),
'Server-ID': serverId,
'SDK-Version' : project.version,
'Artifact-ID' : project.name
}
}

modifyPom {
project {
name projectName
description 'the sdk used to program for izou'
url 'https://github.com/intellimate/IzouSDK'

scm {
url 'https://github.com/intellimate/IzouSDK'
connection 'scm:git:[email protected]:intellimate/IzouSDK.git'
developerConnection 'scm:git:[email protected]:intellimate/IzouSDK.git'
}

licenses {
license {
name 'TThe Apache License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
}
}

nexus {
sign = true
}

task release() {
description = 'Release artifacts to nexus'
dependsOn 'uploadArchives', 'closeAndPromoteRepository'
doLast {
println "Released $version"
}
}

task plugin(type: Zip) {
baseName = project.name
version = project.version
def allExcluded = [];
doFirst {
def excluded = ["org.intellimate.izou"];
excluded.addAll(dependencies);
def recursiveAdd
recursiveAdd = { dep ->
allExcluded.add("${dep.module.id.name}-${dep.module.id.version}.jar".toString())
dep.children.each { childResolvedDep ->
if(dep in childResolvedDep.getParents() && childResolvedDep.getConfiguration() == 'compile'){
recursiveAdd(childResolvedDep);
}
}
}

configurations.compile.resolvedConfiguration.firstLevelModuleDependencies.each { dep ->
if (excluded.contains(dep.module.id.group)) {
recursiveAdd(dep)
}
}
}
from (configurations.compile) {
into ('lib/')
exclude { allExcluded.contains(it.file.name) }
exclude(allExcluded)
}
from (sourceSets.main.output.classesDir) {
into ('classes/')
}
from (sourceSets.main.resources) {
into ('classes/')
}
from (new File(project.buildDir, 'tmp/jar/')) {
into ('classes/META-INF/')
}
}

plugin.dependsOn jar
Empty file added build.properties
Empty file.
7 changes: 7 additions & 0 deletions ci/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
if [ "$TRAVIS_PULL_REQUEST" != "false" ] ; then
echo "Skipping deploy"
exit 0
fi

./../gradlew -p .. release
2 changes: 2 additions & 0 deletions ci/gradle.properties.enc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
�<�X5�d��z,�p��'��Z2&��y�!͞�h���ad�Nj����ȭZ��Z��A�5~n��X-�k�w�av(Y�G�ul��DJ� ����DӨ���~k
'*��>^���:�FL�瀠�Dנ����ܥ�t��)�4��<��#�wN�5
Expand Down
Binary file added ci/secring.gpg.enc
Binary file not shown.
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Sun Jun 05 18:02:54 CEST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip
164 changes: 164 additions & 0 deletions gradlew
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
#!/usr/bin/env bash

##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
echo "$*"
}

die ( ) {
echo
echo "$*"
echo
exit 1
}

# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi

# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option

if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi

# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
Loading