ZEST-143 : Fixing up Create Project command line tool.
Project: http://git-wip-us.apache.org/repos/asf/zest-java/repo Commit: http://git-wip-us.apache.org/repos/asf/zest-java/commit/54c1e612 Tree: http://git-wip-us.apache.org/repos/asf/zest-java/tree/54c1e612 Diff: http://git-wip-us.apache.org/repos/asf/zest-java/diff/54c1e612 Branch: refs/heads/develop Commit: 54c1e6122952faae8f683fd8fa50e8f4bb31d86d Parents: 8d97ec0 Author: Niclas Hedhman <[email protected]> Authored: Thu Apr 21 19:19:14 2016 +0800 Committer: Niclas Hedhman <[email protected]> Committed: Thu Apr 21 19:19:16 2016 +0800 ---------------------------------------------------------------------- build.gradle | 25 ++- core/runtime/src/docs/runtime.txt | 2 +- .../zest/bootstrap/DocumentationSupport.java | 75 --------- .../runtime/bootstrap/DocumentationSupport.java | 80 +++++++++ gradle/wrapper/gradle-wrapper.properties | 2 +- .../zest/library/restlet/ZrestApplication.java | 3 +- tools/shell/build.gradle | 7 +- tools/shell/src/bin/zest | 24 --- tools/shell/src/bin/zest.bat_ | 25 --- tools/shell/src/dist/bin/zest | 31 ++++ tools/shell/src/dist/bin/zest.bat_ | 25 +++ .../templates/default/files/app/build.gradle_ | 20 +++ .../src/main/java/__package__/app/package.html | 23 +++ .../app/src/main/resources/___placeholder___ | 0 .../app/src/test/java/__package__/package.html | 21 +++ .../default/files/bootstrap/build.gradle_ | 16 ++ .../__package__/bootstrap/config/package.html_ | 1 + .../bootstrap/connectivity/package.html_ | 1 + .../__package__/bootstrap/domain/package.html_ | 1 + .../bootstrap/infrastructure/package.html_ | 1 + .../src/main/resources/___placeholder___ | 0 .../src/test/java/__package__/package.html_ | 1 + .../etc/templates/default/files/build.gradle_ | 24 +++ .../files/gradle/wrapper/gradle-wrapper.jar_ | Bin 0 -> 51348 bytes .../gradle/wrapper/gradle-wrapper.properties_ | 6 + .../etc/templates/default/files/gradlew.bat_ | 90 ++++++++++ .../dist/etc/templates/default/files/gradlew_ | 164 +++++++++++++++++++ .../templates/default/files/model/build.gradle_ | 7 + .../java/__package__/model/orders/package.html_ | 1 + .../__package__/model/security/package.html_ | 1 + .../model/src/main/resources/___placeholder___ | 0 .../src/test/java/__package__/package.html_ | 1 + .../dist/etc/templates/null/files/build.gradle_ | 23 +++ .../files/gradle/wrapper/gradle-wrapper.jar_ | 0 .../gradle/wrapper/gradle-wrapper.properties_ | 6 + .../dist/etc/templates/null/files/gradlew.bat_ | 90 ++++++++++ .../src/dist/etc/templates/null/files/gradlew_ | 164 +++++++++++++++++++ .../src/main/java/__package__/package.html_ | 1 + .../src/test/java/__package__/package.html_ | 1 + .../templates/restapp/files/app/build.gradle_ | 20 +++ .../src/main/java/__package__/app/package.html | 23 +++ .../app/src/main/resources/___placeholder___ | 0 .../src/main/webapp/WEB-INF/___placeholder___ | 0 .../app/src/test/java/__package__/package.html | 21 +++ .../restapp/files/bootstrap/build.gradle_ | 16 ++ .../__package__/bootstrap/config/package.html_ | 1 + .../bootstrap/connectivity/package.html_ | 1 + .../__package__/bootstrap/domain/package.html_ | 1 + .../bootstrap/infrastructure/package.html_ | 1 + .../src/main/resources/___placeholder___ | 0 .../src/test/java/__package__/package.html_ | 1 + .../etc/templates/restapp/files/build.gradle_ | 24 +++ .../files/gradle/wrapper/gradle-wrapper.jar_ | Bin 0 -> 51348 bytes .../gradle/wrapper/gradle-wrapper.properties_ | 6 + .../etc/templates/restapp/files/gradlew.bat_ | 90 ++++++++++ .../dist/etc/templates/restapp/files/gradlew_ | 164 +++++++++++++++++++ .../templates/restapp/files/model/build.gradle_ | 7 + .../java/__package__/model/orders/package.html_ | 1 + .../__package__/model/security/package.html_ | 1 + .../model/src/main/resources/___placeholder___ | 0 .../src/test/java/__package__/package.html_ | 1 + .../templates/restapp/files/rest/build.gradle_ | 8 + .../__package__/rest/security/package.html_ | 1 + .../rest/src/main/resources/___placeholder___ | 0 .../src/test/java/__package__/package.html_ | 1 + .../etc/templates/singleton/files/build.gradle_ | 23 +++ .../files/gradle/wrapper/gradle-wrapper.jar_ | Bin 0 -> 51348 bytes .../gradle/wrapper/gradle-wrapper.properties_ | 6 + .../etc/templates/singleton/files/gradlew.bat_ | 90 ++++++++++ .../dist/etc/templates/singleton/files/gradlew_ | 164 +++++++++++++++++++ .../src/main/java/__package__/package.html_ | 1 + .../src/test/java/__package__/package.html_ | 1 + .../templates/default/files/app/build.gradle_ | 20 --- .../src/main/java/__package__/app/package.html | 23 --- .../app/src/main/resources/___placeholder___ | 0 .../app/src/test/java/__package__/package.html | 21 --- .../default/files/bootstrap/build.gradle_ | 16 -- .../__package__/bootstrap/config/package.html_ | 1 - .../bootstrap/connectivity/package.html_ | 1 - .../__package__/bootstrap/domain/package.html_ | 1 - .../bootstrap/infrastructure/package.html_ | 1 - .../src/main/resources/___placeholder___ | 0 .../src/test/java/__package__/package.html_ | 1 - .../etc/templates/default/files/build.gradle_ | 26 --- .../files/gradle/wrapper/gradle-wrapper.jar_ | Bin 51348 -> 0 bytes .../gradle/wrapper/gradle-wrapper.properties_ | 6 - .../etc/templates/default/files/gradlew.bat_ | 90 ---------- .../src/etc/templates/default/files/gradlew_ | 164 ------------------- .../templates/default/files/model/build.gradle_ | 7 - .../java/__package__/model/orders/package.html_ | 1 - .../__package__/model/security/package.html_ | 1 - .../model/src/main/resources/___placeholder___ | 0 .../src/test/java/__package__/package.html_ | 1 - .../src/etc/templates/null/files/build.gradle_ | 24 --- .../files/gradle/wrapper/gradle-wrapper.jar_ | 0 .../gradle/wrapper/gradle-wrapper.properties_ | 6 - .../src/etc/templates/null/files/gradlew.bat_ | 90 ---------- .../shell/src/etc/templates/null/files/gradlew_ | 164 ------------------- .../src/main/java/__package__/package.html_ | 1 - .../src/test/java/__package__/package.html_ | 1 - .../templates/restapp/files/app/build.gradle_ | 20 --- .../src/main/java/__package__/app/package.html | 23 --- .../app/src/main/resources/___placeholder___ | 0 .../src/main/webapp/WEB-INF/___placeholder___ | 0 .../app/src/test/java/__package__/package.html | 21 --- .../restapp/files/bootstrap/build.gradle_ | 16 -- .../__package__/bootstrap/config/package.html_ | 1 - .../bootstrap/connectivity/package.html_ | 1 - .../__package__/bootstrap/domain/package.html_ | 1 - .../bootstrap/infrastructure/package.html_ | 1 - .../src/main/resources/___placeholder___ | 0 .../src/test/java/__package__/package.html_ | 1 - .../etc/templates/restapp/files/build.gradle_ | 26 --- .../files/gradle/wrapper/gradle-wrapper.jar_ | Bin 51348 -> 0 bytes .../gradle/wrapper/gradle-wrapper.properties_ | 6 - .../etc/templates/restapp/files/gradlew.bat_ | 90 ---------- .../src/etc/templates/restapp/files/gradlew_ | 164 ------------------- .../templates/restapp/files/model/build.gradle_ | 7 - .../java/__package__/model/orders/package.html_ | 1 - .../__package__/model/security/package.html_ | 1 - .../model/src/main/resources/___placeholder___ | 0 .../src/test/java/__package__/package.html_ | 1 - .../templates/restapp/files/rest/build.gradle_ | 8 - .../__package__/rest/security/package.html_ | 1 - .../rest/src/main/resources/___placeholder___ | 0 .../src/test/java/__package__/package.html_ | 1 - .../etc/templates/singleton/files/build.gradle_ | 24 --- .../files/gradle/wrapper/gradle-wrapper.jar_ | Bin 51348 -> 0 bytes .../gradle/wrapper/gradle-wrapper.properties_ | 6 - .../etc/templates/singleton/files/gradlew.bat_ | 90 ---------- .../src/etc/templates/singleton/files/gradlew_ | 164 ------------------- .../src/main/java/__package__/package.html_ | 1 - .../src/test/java/__package__/package.html_ | 1 - .../org/apache/zest/tools/shell/FileUtils.java | 30 ++++ .../java/org/apache/zest/tools/shell/Main.java | 6 +- .../create/project/AbstractProjectCreator.java | 15 ++ .../create/project/DefaultProjectCreator.java | 2 +- .../create/project/RestProjectCreator.java | 2 +- .../create/project/SingletonProjectCreator.java | 2 + .../common/ApplicationAssemblerWriter.java | 49 +++--- .../project/common/ConfigLayerWriter.java | 6 +- .../project/common/ConfigModuleWriter.java | 6 +- .../project/common/ConnectivityLayerWriter.java | 6 +- .../create/project/common/CrudModuleWriter.java | 6 +- .../create/project/common/CustomerWriter.java | 6 +- .../project/common/DomainLayerWriter.java | 6 +- .../common/FileConfigurationModuleWriter.java | 6 +- .../HardCodedSecurityRepositoryMixinWriter.java | 6 +- .../project/common/IndexingModuleWriter.java | 6 +- .../common/InfrastructureLayerWriter.java | 6 +- .../create/project/common/OrderItemWriter.java | 6 +- .../project/common/OrderModuleWriter.java | 6 +- .../create/project/common/OrderWriter.java | 6 +- .../project/common/SecurityModuleWriter.java | 6 +- .../common/SecurityRepositoryWriter.java | 6 +- .../common/SerializationModuleWriter.java | 6 +- .../create/project/common/SettingsWriter.java | 75 --------- .../project/common/StorageModuleWriter.java | 6 +- .../project/defaultp/ApplicationWriter.java | 6 +- .../create/project/defaultp/SettingsWriter.java | 80 +++++++++ .../project/restapp/ApplicationWriter.java | 6 +- .../create/project/restapp/IndexHtmlWriter.java | 10 +- .../project/restapp/RestModuleWriter.java | 6 +- .../create/project/restapp/SettingsWriter.java | 81 +++++++++ .../project/restapp/SimpleEnrolerWriter.java | 6 +- .../project/restapp/SimpleVerifierWriter.java | 6 +- .../create/project/restapp/WebXmlWriter.java | 12 +- .../project/singleton/SettingsWriter.java | 76 +++++++++ .../SingletonApplicationAssemblerWriter.java | 6 +- .../project/singleton/StartupServiceWriter.java | 8 +- .../zest/tools/shell/help/HelpCommand.java | 10 +- .../zest/tools/shell/HelpCommandTest.java | 43 +++++ 172 files changed, 1935 insertions(+), 1685 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/build.gradle ---------------------------------------------------------------------- diff --git a/build.gradle b/build.gradle index 24ad44f..ad9a1c6 100644 --- a/build.gradle +++ b/build.gradle @@ -18,6 +18,8 @@ * */ +import org.apache.tools.ant.filters.ReplaceTokens + project.ext { title = "Apache Zest⢠(Java Edition) SDK" description = "Apache Zest⢠(Java Edition) is a framework for domain centric application development, including evolved concepts from AOP, DI and DDD." @@ -833,9 +835,23 @@ def libsImage = copySpec { } } -def binFoldersImage = copySpec { - from "tools/shell/src/bin/**" - into( "bin/" ) +def extraDistTextImage = copySpec { + releaseApprovedProjects.collect { p -> + from fileTree(dir: "$p.projectDir/src/dist/", include: '**', exclude: "**/*.jar*") + eachFile { + filter(ReplaceTokens, tokens: [version: version]) + } + } + into( "." ) +} + +def extraDistBinImage = copySpec { + releaseApprovedProjects.collect { p -> + from "$p.projectDir/src/dist/" + include "**/*.jar" + include "**/*.jar_" + } + into( "." ) } def binDistNoticesImage = copySpec { @@ -850,7 +866,8 @@ def binDistImage = copySpec { with docsImage with reportsDistImage with runtimeDependenciesListImage - with binFoldersImage + with extraDistTextImage + with extraDistBinImage with libsImage } http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/core/runtime/src/docs/runtime.txt ---------------------------------------------------------------------- diff --git a/core/runtime/src/docs/runtime.txt b/core/runtime/src/docs/runtime.txt index e9f525d..3d5e7cb 100644 --- a/core/runtime/src/docs/runtime.txt +++ b/core/runtime/src/docs/runtime.txt @@ -48,6 +48,6 @@ Fictitious example of using a hypothetical Dalvik capable classloader; [source,java] -------------- -source=core/runtime/src/test/java/org/apache/zest/bootstrap/DocumentationSupport.java +source=core/runtime/src/test/java/org/apache/zest/runtime/bootstrap/DocumentationSupport.java tag=customAssemblyHelper -------------- http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/core/runtime/src/test/java/org/apache/zest/bootstrap/DocumentationSupport.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/bootstrap/DocumentationSupport.java b/core/runtime/src/test/java/org/apache/zest/bootstrap/DocumentationSupport.java deleted file mode 100644 index 8e17961..0000000 --- a/core/runtime/src/test/java/org/apache/zest/bootstrap/DocumentationSupport.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * - */ - -package org.apache.zest.bootstrap; - -import org.apache.zest.api.structure.Application; -import org.apache.zest.runtime.bootstrap.AssemblyHelper; -import org.apache.zest.runtime.composite.FragmentClassLoader; - -public class DocumentationSupport -{ - // START SNIPPET: customAssemblyHelper - private static Energy4Java zest; - - private static Application application; - - public static void main( String[] args ) - throws Exception - { - // Create a Zest Runtime - zest = new Energy4Java(); - application = zest.newApplication( new ApplicationAssembler() - { - - @Override - public ApplicationAssembly assemble( ApplicationAssemblyFactory appFactory ) - throws AssemblyException - { - ApplicationAssembly assembly = appFactory.newApplicationAssembly(); - assembly.setMetaInfo( new DalvikAssemblyHelper() ); - // END SNIPPET: customAssemblyHelper - // START SNIPPET: customAssemblyHelper - return assembly; - } - } ); - // activate the application - application.activate(); - } - - public static class DalvikAssemblyHelper extends AssemblyHelper - { - @Override - protected FragmentClassLoader instantiateFragmentClassLoader( ClassLoader parent ) - { - return new DalvikFragmentClassLoader( parent ); - } - } - - public static class DalvikFragmentClassLoader extends FragmentClassLoader - { - - public DalvikFragmentClassLoader( ClassLoader parent ) - { - super( parent ); - } - } - // END SNIPPET: customAssemblyHelper -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/core/runtime/src/test/java/org/apache/zest/runtime/bootstrap/DocumentationSupport.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/bootstrap/DocumentationSupport.java b/core/runtime/src/test/java/org/apache/zest/runtime/bootstrap/DocumentationSupport.java new file mode 100644 index 0000000..b962077 --- /dev/null +++ b/core/runtime/src/test/java/org/apache/zest/runtime/bootstrap/DocumentationSupport.java @@ -0,0 +1,80 @@ +/* + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + */ + +package org.apache.zest.runtime.bootstrap; + +import org.apache.zest.api.structure.Application; +import org.apache.zest.bootstrap.ApplicationAssembler; +import org.apache.zest.bootstrap.ApplicationAssembly; +import org.apache.zest.bootstrap.ApplicationAssemblyFactory; +import org.apache.zest.bootstrap.AssemblyException; +import org.apache.zest.bootstrap.Energy4Java; +import org.apache.zest.runtime.bootstrap.AssemblyHelper; +import org.apache.zest.runtime.composite.FragmentClassLoader; + +public class DocumentationSupport +{ + // START SNIPPET: customAssemblyHelper + private static Energy4Java zest; + + private static Application application; + + public static void main( String[] args ) + throws Exception + { + // Create a Zest Runtime + zest = new Energy4Java(); + application = zest.newApplication( new ApplicationAssembler() + { + + @Override + public ApplicationAssembly assemble( ApplicationAssemblyFactory appFactory ) + throws AssemblyException + { + ApplicationAssembly assembly = appFactory.newApplicationAssembly(); + assembly.setMetaInfo( new DalvikAssemblyHelper() ); + // END SNIPPET: customAssemblyHelper + // START SNIPPET: customAssemblyHelper + return assembly; + } + } ); + // activate the application + application.activate(); + } + + public static class DalvikAssemblyHelper extends AssemblyHelper + { + @Override + protected FragmentClassLoader instantiateFragmentClassLoader( ClassLoader parent ) + { + return new DalvikFragmentClassLoader( parent ); + } + } + + public static class DalvikFragmentClassLoader extends FragmentClassLoader + { + + public DalvikFragmentClassLoader( ClassLoader parent ) + { + super( parent ); + } + } + // END SNIPPET: customAssemblyHelper +} http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/gradle/wrapper/gradle-wrapper.properties ---------------------------------------------------------------------- diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index dfe2c00..8ed5176 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -23,4 +23,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.11-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-bin.zip http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/libraries/restlet/src/main/java/org/apache/zest/library/restlet/ZrestApplication.java ---------------------------------------------------------------------- diff --git a/libraries/restlet/src/main/java/org/apache/zest/library/restlet/ZrestApplication.java b/libraries/restlet/src/main/java/org/apache/zest/library/restlet/ZrestApplication.java index abe11da..888b1c8 100644 --- a/libraries/restlet/src/main/java/org/apache/zest/library/restlet/ZrestApplication.java +++ b/libraries/restlet/src/main/java/org/apache/zest/library/restlet/ZrestApplication.java @@ -85,9 +85,8 @@ public abstract class ZrestApplication extends org.restlet.Application public synchronized void start() throws Exception { - System.err.println( "HABBA!!!!!" ); Series<Parameter> parameters = getContext().getParameters(); - String mode = parameters.getFirstValue( "org.sensorsink.kooda.mode" ); + String mode = parameters.getFirstValue( "org.apache.zest.runtime.mode" ); createApplication( mode ); zestApplication.activate(); Module module = zestApplication.findModule( getConnectivityLayer(), getConnectivityModule() ); http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/build.gradle ---------------------------------------------------------------------- diff --git a/tools/shell/build.gradle b/tools/shell/build.gradle index bdc6716..f20fbc3 100644 --- a/tools/shell/build.gradle +++ b/tools/shell/build.gradle @@ -23,7 +23,12 @@ apply plugin: 'application' description = "Command line tools for building Apache Zest⢠applications." mainClassName = "org.apache.zest.tools.shell.Main" -jar { manifest { name = "Apache Zest⢠Command Line" } } +jar { + manifest { + name = "Apache Zest⢠Command Line" + attributes("Main-Class": mainClassName ) + } +} dependencies { testCompile libraries.junit http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/bin/zest ---------------------------------------------------------------------- diff --git a/tools/shell/src/bin/zest b/tools/shell/src/bin/zest deleted file mode 100644 index 778f318..0000000 --- a/tools/shell/src/bin/zest +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Absolute path to this script, e.g. /home/user/bin/foo.sh -ZESTSCRIPT=$(readlink -f "$0") -# Absolute path this script is in, thus /home/user/bin -ZESTPATH=$(dirname "$ZESTSCRIPT") - -java -Dzest.home=$ZESTPATH -jar org.apache.zest.tools.shell-@@version@@.jar "$@" - http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/bin/zest.bat_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/bin/zest.bat_ b/tools/shell/src/bin/zest.bat_ deleted file mode 100644 index 3d85fbf..0000000 --- a/tools/shell/src/bin/zest.bat_ +++ /dev/null @@ -1,25 +0,0 @@ -REM Licensed to the Apache Software Foundation (ASF) under one or more -REM contributor license agreements. See the NOTICE file distributed with -REM this work for additional information regarding copyright ownership. -REM The ASF licenses this file to You under the Apache License, Version 2.0 -REM (the "License"); you may not use this file except in compliance with -REM the License. You may obtain a copy of the License at -REM -REM http://www.apache.org/licenses/LICENSE-2.0 -REM -REM Unless required by applicable law or agreed to in writing, software -REM distributed under the License is distributed on an "AS IS" BASIS, -REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -REM See the License for the specific language governing permissions and -REM limitations under the License. - - -REM TODO: Windows user to fix this script, please! - -REM Absolute path to this script, e.g. /home/user/bin/foo.sh -REM ZESTSCRIPT=$(readlink -f "$0") -REM Absolute path this script is in, thus /home/user/bin -REM ZESTPATH=$(dirname "$ZESTSCRIPT") - -java -Dzest.home=$ZESTPATH -jar org.apache.zest.tools.shell-@@version@@.jar "$@" - http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/bin/zest ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/bin/zest b/tools/shell/src/dist/bin/zest new file mode 100644 index 0000000..c1918de --- /dev/null +++ b/tools/shell/src/dist/bin/zest @@ -0,0 +1,31 @@ +#!/bin/sh + +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Capture current directory +CWD=`pwd` + +# Goto directory where this script was started from. +cd `dirname $0` +# Up one level +cd .. +# Get the home directory of Zest +ZESTPATH=`pwd` + +# Restore the current directory +cd $CWD + +java -Dzest.home=$ZESTPATH -jar $ZESTPATH/libs/org.apache.zest.tool.shell-@[email protected] "$@" http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/bin/zest.bat_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/bin/zest.bat_ b/tools/shell/src/dist/bin/zest.bat_ new file mode 100644 index 0000000..3d85fbf --- /dev/null +++ b/tools/shell/src/dist/bin/zest.bat_ @@ -0,0 +1,25 @@ +REM Licensed to the Apache Software Foundation (ASF) under one or more +REM contributor license agreements. See the NOTICE file distributed with +REM this work for additional information regarding copyright ownership. +REM The ASF licenses this file to You under the Apache License, Version 2.0 +REM (the "License"); you may not use this file except in compliance with +REM the License. You may obtain a copy of the License at +REM +REM http://www.apache.org/licenses/LICENSE-2.0 +REM +REM Unless required by applicable law or agreed to in writing, software +REM distributed under the License is distributed on an "AS IS" BASIS, +REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +REM See the License for the specific language governing permissions and +REM limitations under the License. + + +REM TODO: Windows user to fix this script, please! + +REM Absolute path to this script, e.g. /home/user/bin/foo.sh +REM ZESTSCRIPT=$(readlink -f "$0") +REM Absolute path this script is in, thus /home/user/bin +REM ZESTPATH=$(dirname "$ZESTSCRIPT") + +java -Dzest.home=$ZESTPATH -jar org.apache.zest.tools.shell-@@version@@.jar "$@" + http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/default/files/app/build.gradle_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/default/files/app/build.gradle_ b/tools/shell/src/dist/etc/templates/default/files/app/build.gradle_ new file mode 100644 index 0000000..5a19653 --- /dev/null +++ b/tools/shell/src/dist/etc/templates/default/files/app/build.gradle_ @@ -0,0 +1,20 @@ + +apply plugin: 'war' +apply plugin: 'jetty' + +dependencies { + compile project( ":bootstrap" ) + compile project( ":model" ) + compile project( ":rest" ) + + compile "org.apache.zest.core:org.apache.zest.core.spi:$zestVersion" + compile "org.apache.zest.core:org.apache.zest.core.bootstrap:$zestVersion" + compile "org.apache.zest.library:org.apache.zest.library.servlet:$zestVersion" + + compile "javax.servlet:servlet-api:2.5" + compile "org.restlet.jee:org.restlet:2.3.4" + + runtime "org.apache.zest.core:org.apache.zest.core.runtime:$zestVersion" + runtime "org.restlet.jee:org.restlet.ext.servlet:2.3.4" + +} http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/default/files/app/src/main/java/__package__/app/package.html ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/default/files/app/src/main/java/__package__/app/package.html b/tools/shell/src/dist/etc/templates/default/files/app/src/main/java/__package__/app/package.html new file mode 100644 index 0000000..1f859fb --- /dev/null +++ b/tools/shell/src/dist/etc/templates/default/files/app/src/main/java/__package__/app/package.html @@ -0,0 +1,23 @@ +<!-- + ~ 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 + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + ~ + ~ + --> + +<html> +<body>This package contains the bootstrap code.</body> +</html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/default/files/app/src/main/resources/___placeholder___ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/default/files/app/src/main/resources/___placeholder___ b/tools/shell/src/dist/etc/templates/default/files/app/src/main/resources/___placeholder___ new file mode 100644 index 0000000..e69de29 http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/default/files/app/src/test/java/__package__/package.html ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/default/files/app/src/test/java/__package__/package.html b/tools/shell/src/dist/etc/templates/default/files/app/src/test/java/__package__/package.html new file mode 100644 index 0000000..8bb0a631 --- /dev/null +++ b/tools/shell/src/dist/etc/templates/default/files/app/src/test/java/__package__/package.html @@ -0,0 +1,21 @@ +<!-- + ~ 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 + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + ~ + ~ + --> + +<html><body>Test directory</body></html> http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/default/files/bootstrap/build.gradle_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/default/files/bootstrap/build.gradle_ b/tools/shell/src/dist/etc/templates/default/files/bootstrap/build.gradle_ new file mode 100644 index 0000000..f26f7f8 --- /dev/null +++ b/tools/shell/src/dist/etc/templates/default/files/bootstrap/build.gradle_ @@ -0,0 +1,16 @@ + +dependencies { + compile project( ":model" ) + compile project( ":rest" ) + + compile "org.apache.zest.core:org.apache.zest.core.spi:$zestVersion" + compile "org.apache.zest.core:org.apache.zest.core.bootstrap:$zestVersion" + + + compile "org.apache.zest.library:org.apache.zest.library.fileconfig:$zestVersion" + compile "org.apache.zest.library:org.apache.zest.library.restlet:$zestVersion" + compile "org.apache.zest.extension:org.apache.zest.extension.entitystore-file:$zestVersion" + compile "org.apache.zest.extension:org.apache.zest.extension.indexing-rdf:$zestVersion" + compile "org.apache.zest.extension:org.apache.zest.extension.valueserialization-jackson:$zestVersion" + +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/java/__package__/bootstrap/config/package.html_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/java/__package__/bootstrap/config/package.html_ b/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/java/__package__/bootstrap/config/package.html_ new file mode 100644 index 0000000..e4bffa5 --- /dev/null +++ b/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/java/__package__/bootstrap/config/package.html_ @@ -0,0 +1 @@ +<html><body>This package contains the assembly information for the Config layer.</body></html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/java/__package__/bootstrap/connectivity/package.html_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/java/__package__/bootstrap/connectivity/package.html_ b/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/java/__package__/bootstrap/connectivity/package.html_ new file mode 100644 index 0000000..21dbaa9 --- /dev/null +++ b/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/java/__package__/bootstrap/connectivity/package.html_ @@ -0,0 +1 @@ +<html><body>This package contains the assembly information for the Connectivity layer.</body></html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/java/__package__/bootstrap/domain/package.html_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/java/__package__/bootstrap/domain/package.html_ b/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/java/__package__/bootstrap/domain/package.html_ new file mode 100644 index 0000000..2bdc426 --- /dev/null +++ b/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/java/__package__/bootstrap/domain/package.html_ @@ -0,0 +1 @@ +<html><body>This package contains the assembly information for the Domain layer.</body></html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/java/__package__/bootstrap/infrastructure/package.html_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/java/__package__/bootstrap/infrastructure/package.html_ b/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/java/__package__/bootstrap/infrastructure/package.html_ new file mode 100644 index 0000000..cf2f9b5 --- /dev/null +++ b/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/java/__package__/bootstrap/infrastructure/package.html_ @@ -0,0 +1 @@ +<html><body>This package contains the assembly information for the Infrastructure layer.</body></html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/resources/___placeholder___ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/resources/___placeholder___ b/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/resources/___placeholder___ new file mode 100644 index 0000000..e69de29 http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/test/java/__package__/package.html_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/test/java/__package__/package.html_ b/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/test/java/__package__/package.html_ new file mode 100644 index 0000000..300838d --- /dev/null +++ b/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/test/java/__package__/package.html_ @@ -0,0 +1 @@ +<html><body>Tests package</body></html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/default/files/build.gradle_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/default/files/build.gradle_ b/tools/shell/src/dist/etc/templates/default/files/build.gradle_ new file mode 100644 index 0000000..3d5b366 --- /dev/null +++ b/tools/shell/src/dist/etc/templates/default/files/build.gradle_ @@ -0,0 +1,24 @@ + +version = 1.0 + +rootProject.ext { + zestVersion = @version@ +} + +allprojects() { + apply plugin: 'java' + apply plugin: 'idea' + apply plugin: 'maven' + + repositories { + mavenLocal() + mavenCentral() + maven { name 'restlet-repo'; url 'http://maven.restlet.org/' } + } + + dependencies { + compile "org.apache.zest.core:org.apache.zest.core.api:$zestVersion" + testCompile "org.apache.zest.core:org.apache.zest.core.testsupport:$zestVersion" + } +} + http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/default/files/gradle/wrapper/gradle-wrapper.jar_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/default/files/gradle/wrapper/gradle-wrapper.jar_ b/tools/shell/src/dist/etc/templates/default/files/gradle/wrapper/gradle-wrapper.jar_ new file mode 100644 index 0000000..0087cd3 Binary files /dev/null and b/tools/shell/src/dist/etc/templates/default/files/gradle/wrapper/gradle-wrapper.jar_ differ http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/default/files/gradle/wrapper/gradle-wrapper.properties_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/default/files/gradle/wrapper/gradle-wrapper.properties_ b/tools/shell/src/dist/etc/templates/default/files/gradle/wrapper/gradle-wrapper.properties_ new file mode 100644 index 0000000..fafa8dd --- /dev/null +++ b/tools/shell/src/dist/etc/templates/default/files/gradle/wrapper/gradle-wrapper.properties_ @@ -0,0 +1,6 @@ +#Mon Jul 06 10:43:59 EEST 2015 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.11-bin.zip http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/default/files/gradlew.bat_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/default/files/gradlew.bat_ b/tools/shell/src/dist/etc/templates/default/files/gradlew.bat_ new file mode 100644 index 0000000..8a0b282 --- /dev/null +++ b/tools/shell/src/dist/etc/templates/default/files/gradlew.bat_ @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/default/files/gradlew_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/default/files/gradlew_ b/tools/shell/src/dist/etc/templates/default/files/gradlew_ new file mode 100755 index 0000000..91a7e26 --- /dev/null +++ b/tools/shell/src/dist/etc/templates/default/files/gradlew_ @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# 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 +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched. +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# 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\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +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" ] ; 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"` + + # 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 "$@" http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/default/files/model/build.gradle_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/default/files/model/build.gradle_ b/tools/shell/src/dist/etc/templates/default/files/model/build.gradle_ new file mode 100644 index 0000000..83f55b2 --- /dev/null +++ b/tools/shell/src/dist/etc/templates/default/files/model/build.gradle_ @@ -0,0 +1,7 @@ + + +dependencies { + + compile "org.restlet.jee:org.restlet:2.3.4" + +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/default/files/model/src/main/java/__package__/model/orders/package.html_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/default/files/model/src/main/java/__package__/model/orders/package.html_ b/tools/shell/src/dist/etc/templates/default/files/model/src/main/java/__package__/model/orders/package.html_ new file mode 100644 index 0000000..441cb85 --- /dev/null +++ b/tools/shell/src/dist/etc/templates/default/files/model/src/main/java/__package__/model/orders/package.html_ @@ -0,0 +1 @@ +<html><body>Very simple Domain Model to showcase the features of the Restlet library</body></html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/default/files/model/src/main/java/__package__/model/security/package.html_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/default/files/model/src/main/java/__package__/model/security/package.html_ b/tools/shell/src/dist/etc/templates/default/files/model/src/main/java/__package__/model/security/package.html_ new file mode 100644 index 0000000..bcf0ee4 --- /dev/null +++ b/tools/shell/src/dist/etc/templates/default/files/model/src/main/java/__package__/model/security/package.html_ @@ -0,0 +1 @@ +<html><body>Very simple Security Model to showcase the features of the Restlet library</body></html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/default/files/model/src/main/resources/___placeholder___ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/default/files/model/src/main/resources/___placeholder___ b/tools/shell/src/dist/etc/templates/default/files/model/src/main/resources/___placeholder___ new file mode 100644 index 0000000..e69de29 http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/default/files/model/src/test/java/__package__/package.html_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/default/files/model/src/test/java/__package__/package.html_ b/tools/shell/src/dist/etc/templates/default/files/model/src/test/java/__package__/package.html_ new file mode 100644 index 0000000..300838d --- /dev/null +++ b/tools/shell/src/dist/etc/templates/default/files/model/src/test/java/__package__/package.html_ @@ -0,0 +1 @@ +<html><body>Tests package</body></html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/null/files/build.gradle_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/null/files/build.gradle_ b/tools/shell/src/dist/etc/templates/null/files/build.gradle_ new file mode 100644 index 0000000..3234abc --- /dev/null +++ b/tools/shell/src/dist/etc/templates/null/files/build.gradle_ @@ -0,0 +1,23 @@ + +version = 1.0 + +rootProject.ext { + zestVersion = @version@ +} + +allprojects() { + apply plugin: 'java' + apply plugin: 'idea' + apply plugin: 'maven' + + repositories { + mavenLocal() + mavenCentral() + } + + dependencies { + compile "org.apache.zest.core:org.apache.zest.core.api:$zestVersion" + testCompile "org.apache.zest.core:org.apache.zest.core.testsupport:$zestVersion" + } +} + http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/null/files/gradle/wrapper/gradle-wrapper.jar_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/null/files/gradle/wrapper/gradle-wrapper.jar_ b/tools/shell/src/dist/etc/templates/null/files/gradle/wrapper/gradle-wrapper.jar_ new file mode 100644 index 0000000..e69de29 http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/null/files/gradle/wrapper/gradle-wrapper.properties_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/null/files/gradle/wrapper/gradle-wrapper.properties_ b/tools/shell/src/dist/etc/templates/null/files/gradle/wrapper/gradle-wrapper.properties_ new file mode 100644 index 0000000..fafa8dd --- /dev/null +++ b/tools/shell/src/dist/etc/templates/null/files/gradle/wrapper/gradle-wrapper.properties_ @@ -0,0 +1,6 @@ +#Mon Jul 06 10:43:59 EEST 2015 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.11-bin.zip http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/null/files/gradlew.bat_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/null/files/gradlew.bat_ b/tools/shell/src/dist/etc/templates/null/files/gradlew.bat_ new file mode 100644 index 0000000..8a0b282 --- /dev/null +++ b/tools/shell/src/dist/etc/templates/null/files/gradlew.bat_ @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/null/files/gradlew_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/null/files/gradlew_ b/tools/shell/src/dist/etc/templates/null/files/gradlew_ new file mode 100644 index 0000000..91a7e26 --- /dev/null +++ b/tools/shell/src/dist/etc/templates/null/files/gradlew_ @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# 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 +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched. +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# 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\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +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" ] ; 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"` + + # 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 "$@" http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/null/files/src/main/java/__package__/package.html_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/null/files/src/main/java/__package__/package.html_ b/tools/shell/src/dist/etc/templates/null/files/src/main/java/__package__/package.html_ new file mode 100644 index 0000000..e071c79 --- /dev/null +++ b/tools/shell/src/dist/etc/templates/null/files/src/main/java/__package__/package.html_ @@ -0,0 +1 @@ +<html><body>Package for the Java source files</body></html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/null/files/src/test/java/__package__/package.html_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/null/files/src/test/java/__package__/package.html_ b/tools/shell/src/dist/etc/templates/null/files/src/test/java/__package__/package.html_ new file mode 100644 index 0000000..eaefd36 --- /dev/null +++ b/tools/shell/src/dist/etc/templates/null/files/src/test/java/__package__/package.html_ @@ -0,0 +1 @@ +<html><body>Package for testing classes.</body></html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/restapp/files/app/build.gradle_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/restapp/files/app/build.gradle_ b/tools/shell/src/dist/etc/templates/restapp/files/app/build.gradle_ new file mode 100644 index 0000000..5a19653 --- /dev/null +++ b/tools/shell/src/dist/etc/templates/restapp/files/app/build.gradle_ @@ -0,0 +1,20 @@ + +apply plugin: 'war' +apply plugin: 'jetty' + +dependencies { + compile project( ":bootstrap" ) + compile project( ":model" ) + compile project( ":rest" ) + + compile "org.apache.zest.core:org.apache.zest.core.spi:$zestVersion" + compile "org.apache.zest.core:org.apache.zest.core.bootstrap:$zestVersion" + compile "org.apache.zest.library:org.apache.zest.library.servlet:$zestVersion" + + compile "javax.servlet:servlet-api:2.5" + compile "org.restlet.jee:org.restlet:2.3.4" + + runtime "org.apache.zest.core:org.apache.zest.core.runtime:$zestVersion" + runtime "org.restlet.jee:org.restlet.ext.servlet:2.3.4" + +} http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/restapp/files/app/src/main/java/__package__/app/package.html ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/restapp/files/app/src/main/java/__package__/app/package.html b/tools/shell/src/dist/etc/templates/restapp/files/app/src/main/java/__package__/app/package.html new file mode 100644 index 0000000..1f859fb --- /dev/null +++ b/tools/shell/src/dist/etc/templates/restapp/files/app/src/main/java/__package__/app/package.html @@ -0,0 +1,23 @@ +<!-- + ~ 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 + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + ~ + ~ + --> + +<html> +<body>This package contains the bootstrap code.</body> +</html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/restapp/files/app/src/main/resources/___placeholder___ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/restapp/files/app/src/main/resources/___placeholder___ b/tools/shell/src/dist/etc/templates/restapp/files/app/src/main/resources/___placeholder___ new file mode 100644 index 0000000..e69de29 http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/restapp/files/app/src/main/webapp/WEB-INF/___placeholder___ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/restapp/files/app/src/main/webapp/WEB-INF/___placeholder___ b/tools/shell/src/dist/etc/templates/restapp/files/app/src/main/webapp/WEB-INF/___placeholder___ new file mode 100644 index 0000000..e69de29 http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/restapp/files/app/src/test/java/__package__/package.html ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/restapp/files/app/src/test/java/__package__/package.html b/tools/shell/src/dist/etc/templates/restapp/files/app/src/test/java/__package__/package.html new file mode 100644 index 0000000..8bb0a631 --- /dev/null +++ b/tools/shell/src/dist/etc/templates/restapp/files/app/src/test/java/__package__/package.html @@ -0,0 +1,21 @@ +<!-- + ~ 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 + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + ~ + ~ + --> + +<html><body>Test directory</body></html> http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/build.gradle_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/build.gradle_ b/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/build.gradle_ new file mode 100644 index 0000000..f26f7f8 --- /dev/null +++ b/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/build.gradle_ @@ -0,0 +1,16 @@ + +dependencies { + compile project( ":model" ) + compile project( ":rest" ) + + compile "org.apache.zest.core:org.apache.zest.core.spi:$zestVersion" + compile "org.apache.zest.core:org.apache.zest.core.bootstrap:$zestVersion" + + + compile "org.apache.zest.library:org.apache.zest.library.fileconfig:$zestVersion" + compile "org.apache.zest.library:org.apache.zest.library.restlet:$zestVersion" + compile "org.apache.zest.extension:org.apache.zest.extension.entitystore-file:$zestVersion" + compile "org.apache.zest.extension:org.apache.zest.extension.indexing-rdf:$zestVersion" + compile "org.apache.zest.extension:org.apache.zest.extension.valueserialization-jackson:$zestVersion" + +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/java/__package__/bootstrap/config/package.html_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/java/__package__/bootstrap/config/package.html_ b/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/java/__package__/bootstrap/config/package.html_ new file mode 100644 index 0000000..e4bffa5 --- /dev/null +++ b/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/java/__package__/bootstrap/config/package.html_ @@ -0,0 +1 @@ +<html><body>This package contains the assembly information for the Config layer.</body></html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/java/__package__/bootstrap/connectivity/package.html_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/java/__package__/bootstrap/connectivity/package.html_ b/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/java/__package__/bootstrap/connectivity/package.html_ new file mode 100644 index 0000000..21dbaa9 --- /dev/null +++ b/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/java/__package__/bootstrap/connectivity/package.html_ @@ -0,0 +1 @@ +<html><body>This package contains the assembly information for the Connectivity layer.</body></html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/java/__package__/bootstrap/domain/package.html_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/java/__package__/bootstrap/domain/package.html_ b/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/java/__package__/bootstrap/domain/package.html_ new file mode 100644 index 0000000..2bdc426 --- /dev/null +++ b/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/java/__package__/bootstrap/domain/package.html_ @@ -0,0 +1 @@ +<html><body>This package contains the assembly information for the Domain layer.</body></html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/java/__package__/bootstrap/infrastructure/package.html_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/java/__package__/bootstrap/infrastructure/package.html_ b/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/java/__package__/bootstrap/infrastructure/package.html_ new file mode 100644 index 0000000..cf2f9b5 --- /dev/null +++ b/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/java/__package__/bootstrap/infrastructure/package.html_ @@ -0,0 +1 @@ +<html><body>This package contains the assembly information for the Infrastructure layer.</body></html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/resources/___placeholder___ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/resources/___placeholder___ b/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/resources/___placeholder___ new file mode 100644 index 0000000..e69de29 http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/test/java/__package__/package.html_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/test/java/__package__/package.html_ b/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/test/java/__package__/package.html_ new file mode 100644 index 0000000..300838d --- /dev/null +++ b/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/test/java/__package__/package.html_ @@ -0,0 +1 @@ +<html><body>Tests package</body></html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/restapp/files/build.gradle_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/restapp/files/build.gradle_ b/tools/shell/src/dist/etc/templates/restapp/files/build.gradle_ new file mode 100644 index 0000000..3d5b366 --- /dev/null +++ b/tools/shell/src/dist/etc/templates/restapp/files/build.gradle_ @@ -0,0 +1,24 @@ + +version = 1.0 + +rootProject.ext { + zestVersion = @version@ +} + +allprojects() { + apply plugin: 'java' + apply plugin: 'idea' + apply plugin: 'maven' + + repositories { + mavenLocal() + mavenCentral() + maven { name 'restlet-repo'; url 'http://maven.restlet.org/' } + } + + dependencies { + compile "org.apache.zest.core:org.apache.zest.core.api:$zestVersion" + testCompile "org.apache.zest.core:org.apache.zest.core.testsupport:$zestVersion" + } +} + http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/restapp/files/gradle/wrapper/gradle-wrapper.jar_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/restapp/files/gradle/wrapper/gradle-wrapper.jar_ b/tools/shell/src/dist/etc/templates/restapp/files/gradle/wrapper/gradle-wrapper.jar_ new file mode 100644 index 0000000..0087cd3 Binary files /dev/null and b/tools/shell/src/dist/etc/templates/restapp/files/gradle/wrapper/gradle-wrapper.jar_ differ http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/restapp/files/gradle/wrapper/gradle-wrapper.properties_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/restapp/files/gradle/wrapper/gradle-wrapper.properties_ b/tools/shell/src/dist/etc/templates/restapp/files/gradle/wrapper/gradle-wrapper.properties_ new file mode 100644 index 0000000..fafa8dd --- /dev/null +++ b/tools/shell/src/dist/etc/templates/restapp/files/gradle/wrapper/gradle-wrapper.properties_ @@ -0,0 +1,6 @@ +#Mon Jul 06 10:43:59 EEST 2015 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.11-bin.zip http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/restapp/files/gradlew.bat_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/restapp/files/gradlew.bat_ b/tools/shell/src/dist/etc/templates/restapp/files/gradlew.bat_ new file mode 100644 index 0000000..8a0b282 --- /dev/null +++ b/tools/shell/src/dist/etc/templates/restapp/files/gradlew.bat_ @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/restapp/files/gradlew_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/restapp/files/gradlew_ b/tools/shell/src/dist/etc/templates/restapp/files/gradlew_ new file mode 100755 index 0000000..91a7e26 --- /dev/null +++ b/tools/shell/src/dist/etc/templates/restapp/files/gradlew_ @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# 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 +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched. +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# 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\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +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" ] ; 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"` + + # 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 "$@" http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/restapp/files/model/build.gradle_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/restapp/files/model/build.gradle_ b/tools/shell/src/dist/etc/templates/restapp/files/model/build.gradle_ new file mode 100644 index 0000000..83f55b2 --- /dev/null +++ b/tools/shell/src/dist/etc/templates/restapp/files/model/build.gradle_ @@ -0,0 +1,7 @@ + + +dependencies { + + compile "org.restlet.jee:org.restlet:2.3.4" + +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/restapp/files/model/src/main/java/__package__/model/orders/package.html_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/restapp/files/model/src/main/java/__package__/model/orders/package.html_ b/tools/shell/src/dist/etc/templates/restapp/files/model/src/main/java/__package__/model/orders/package.html_ new file mode 100644 index 0000000..441cb85 --- /dev/null +++ b/tools/shell/src/dist/etc/templates/restapp/files/model/src/main/java/__package__/model/orders/package.html_ @@ -0,0 +1 @@ +<html><body>Very simple Domain Model to showcase the features of the Restlet library</body></html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/restapp/files/model/src/main/java/__package__/model/security/package.html_ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/restapp/files/model/src/main/java/__package__/model/security/package.html_ b/tools/shell/src/dist/etc/templates/restapp/files/model/src/main/java/__package__/model/security/package.html_ new file mode 100644 index 0000000..bcf0ee4 --- /dev/null +++ b/tools/shell/src/dist/etc/templates/restapp/files/model/src/main/java/__package__/model/security/package.html_ @@ -0,0 +1 @@ +<html><body>Very simple Security Model to showcase the features of the Restlet library</body></html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/54c1e612/tools/shell/src/dist/etc/templates/restapp/files/model/src/main/resources/___placeholder___ ---------------------------------------------------------------------- diff --git a/tools/shell/src/dist/etc/templates/restapp/files/model/src/main/resources/___placeholder___ b/tools/shell/src/dist/etc/templates/restapp/files/model/src/main/resources/___placeholder___ new file mode 100644 index 0000000..e69de29
