Permalink
Browse files

removed vertx-boot

  • Loading branch information...
1 parent 2899b53 commit f9b593de953291e5540039100c487dd78bc4c7b3 @purplefox purplefox committed Jul 31, 2012
View
@@ -110,9 +110,6 @@ task assemble(type: Copy, dependsOn: ['preflight', subprojects.assemble]) {
destinationDir file("build/$rootProject.name-$version")
outputs.dir destinationDir
into('bin') {
- from project(':vertx-boot').jar
- }
- into('bin') {
from file('src/dist/scripts')
// fileMode 755
}
View
@@ -14,7 +14,6 @@
* limitations under the License.
*/
-include 'vertx-boot'
include 'vertx-core'
include 'vertx-platform'
include 'vertx-testframework'
@@ -1,21 +0,0 @@
-#
-# Copyright 2011 the original author or authors.
-#
-# Licensed 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.
-#
-vertx.version=@version@
-vertx.name=vert.x
-vertx.description=Effortless asynchronous application development for the modern web and enterprise
-vertx.main=org.vertx.java.deploy.impl.cli.Starter
-vertx.libs=${vertx.install}/conf,${vertx.install}/lib,${vertx.install}/lib/*.jar
-vertx.temp=${vertx.install}/temp
View
@@ -65,7 +65,7 @@ cd "`dirname \"$PRG\"`/.."
APP_HOME="`pwd -P`"
cd "$SAVED"
-CLASSPATH=$APP_HOME/bin/vertx-boot.jar
+CLASSPATH=$APP_HOME/lib/*
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
@@ -165,4 +165,4 @@ function splitJvmOpts() {
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $VERTX_OPTS
-exec "$JAVACMD" "${JVM_OPTS[@]}" -Dvertx.install=$APP_HOME -Djava.util.logging.config.file=$APP_HOME/conf/logging.properties -Djruby.home=$JRUBY_HOME -Djython.home=$JYTHON_HOME -classpath "$CLASSPATH" org.vertx.java.boot.VertxBoot "$@"
+exec "$JAVACMD" "${JVM_OPTS[@]}" -Dvertx.install=$APP_HOME -Djava.util.logging.config.file=$APP_HOME/conf/logging.properties -Djruby.home=$JRUBY_HOME -Djython.home=$JYTHON_HOME -classpath "$CLASSPATH" org.vertx.java.deploy.impl.cli.Starter "$@"
@@ -69,10 +69,10 @@ set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
-set CLASSPATH=%APP_HOME%\bin\vertx-boot.jar
+set CLASSPATH=%APP_HOME%\lib\*
@rem Execute vertx
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %VERTX_OPTS% -Dvertx.install=%APP_HOME% -Djruby.home=%JRUBY_HOME% -Djython.home=%JYTHON_HOME% -classpath "%CLASSPATH%" org.vertx.java.boot.VertxBoot %CMD_LINE_ARGS%
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %VERTX_OPTS% -Dvertx.install=%APP_HOME% -Djruby.home=%JRUBY_HOME% -Djython.home=%JYTHON_HOME% -classpath "%CLASSPATH%" org.vertx.java.deploy.impl.cli.Starter %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
View
@@ -1,26 +0,0 @@
-/*
- * Copyright 2012 the original author or authors.
- *
- * Licensed 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.
- */
-
-apply plugin: 'java'
-
-jar {
- version = ''
- manifest {
- attributes(
- 'Main-Class': 'org.vertx.java.boot.VertxBoot'
- )
- }
-}
@@ -1,248 +0,0 @@
-/*
- * Copyright 2012 the original author or authors.
- *
- * Licensed 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.vertx.java.boot;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.nio.file.FileSystems;
-import java.nio.file.FileVisitResult;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.PathMatcher;
-import java.nio.file.Paths;
-import java.nio.file.SimpleFileVisitor;
-import java.nio.file.StandardOpenOption;
-import java.nio.file.attribute.BasicFileAttributes;
-import java.util.HashSet;
-import java.util.Properties;
-import java.util.Set;
-
-/**
- * This class relies on the existence of a vertx.properties file
- * which contains a pointer to the resources which are to be
- * loaded onto the classpath, and the real main class.<p/>
- * Requires the system variables: vertx.home and vertx.conf
- *
- * @author pidster
- */
-public class VertxBoot {
-
- private static final boolean DEBUG = Boolean.getBoolean("vertx.boot.debug");
-
- public static void main(String... args) {
-
- if (DEBUG) {
- System.out.println("vert.x starting with DEBUG=true");
- }
-
- URL[] classpath = createClasspath();
-
- if (DEBUG) {
- for (URL url : classpath) {
- System.out.format("url:%s %n", url);
- }
- }
-
- startMain(classpath, args);
- }
-
- private static URL[] createClasspath() {
-
- // The minimum we need is a system property telling us
- // what our own install directory is
- Path userDir = stringToPath(System.getProperty("user.dir"));
-
- // The minimum we need is a system property telling us
- // what our own install directory is
- Path vertx = stringToPath(System.getProperty("vertx.install"));
- System.setProperty("vertx.home", vertx.toString());
- System.setProperty("vertx.install", vertx.toString());
-
- // The conf directory is relative to 'vertx.home'
- String vertxConf = System.getProperty("vertx.conf", "conf/vertx.properties");
- Path props = vertx.resolve(vertxConf);
- if (!Files.isReadable(props)) {
- throw new RuntimeException("vertx.properties file missing or unreadable!");
- }
-
- Properties vertxProps = new Properties();
-
- if (DEBUG) {
- System.out.format("vertx.install: %s %n", vertx);
- }
-
- Set<URL> found = new HashSet<>();
-
- try {
- String jrubyHome = System.getProperty("jruby.home");
- if (jrubyHome != null) {
- Path p = stringToPath(jrubyHome + "/lib/jruby.jar");
- found.add(p.toUri().toURL());
- }
-
- String jythonHome = System.getProperty("jython.home");
- if (jrubyHome != null) {
- Path p = stringToPath(jythonHome + "/jython.jar");
- found.add(p.toUri().toURL());
- }
-
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- // Use Java 7 try-with-resources
- try (InputStream is = Files.newInputStream(props, StandardOpenOption.READ)) {
- vertxProps.load(is);
-
- // resolve variables
- resolvePropertyVariables(vertxProps);
-
- // add the loaded & translate properties to System
- System.getProperties().putAll(vertxProps);
-
- // if there's no libs this will blow up fairly quickly
- String loader = vertxProps.getProperty("vertx.libs");
- String[] paths = loader.split(",");
-
- for (String url : paths) {
-
- if (DEBUG) {
- System.out.format("url:%s %n", url);
- }
-
- url = url.replace(File.separator, "/");
-
- // TODO check this works on Windows
- if (url.startsWith(".")) {
- url = stringToPath(url).toString(); // resolve against relative path
- }
-
- // TODO check this works on Windows
- if (!url.startsWith(File.separator) && !url.matches("^[A-Za-z]:[(\\)(/)].*")) {
- url = resolve(userDir, url).toString(); // resolve against current dir
- }
-
- if (url.indexOf('*') > -1) {
- URLMatchingGlobbedPathVisitor visitor = new URLMatchingGlobbedPathVisitor(url);
- Files.walkFileTree(vertx, visitor); // relative to vertx.home
- found.addAll(visitor.getMatches());
- } else {
- Path p = resolve(vertx, url);
- if (Files.isReadable(p)) {
- found.add(p.toUri().toURL());
- }
- }
- }
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- return found.toArray(new URL[found.size()]);
- }
-
- private static void resolvePropertyVariables(Properties properties) {
-
- Set<String> names = properties.stringPropertyNames();
- for (String name : names) {
- String modified = properties.getProperty(name);
- String value = properties.getProperty(name);
-
- int match = -1;
- while ((match = value.indexOf("${", match)) > -1) {
-
- int end = value.indexOf("}", match + 1);
- String variable = value.substring(match + 2, end);
-
- if (System.getProperties().containsKey(variable)) {
- modified = value.replace("${" + variable + "}", System.getProperty(variable));
- }
-
- match = end;
- }
-
- properties.setProperty(name, modified);
- }
- }
-
- private static Path resolve(Path base, String input) {
- if (input == null)
- throw new RuntimeException("'input' must not be null!");
- return base.resolve(input).toAbsolutePath().normalize();
- }
-
- private static Path stringToPath(String input) {
- if (input == null)
- throw new RuntimeException("'input' must not be null!");
- return Paths.get(input).toAbsolutePath().normalize();
- }
-
- private static void startMain(URL[] resources, String[] sargs) {
-
- try {
- ClassLoader tccl = Thread.currentThread().getContextClassLoader();
- URLClassLoader cl = new URLClassLoader(resources, tccl);
- Thread.currentThread().setContextClassLoader(cl);
-
- Class<?> c = cl.loadClass(System.getProperty("vertx.main"));
- Class<?>[] argTypes = {String[].class};
-
- Method method = c.getMethod("main", argTypes);
- method.invoke(null, (Object) sargs);
-
- } catch (ClassNotFoundException | NoSuchMethodException
- | SecurityException | IllegalAccessException
- | IllegalArgumentException | InvocationTargetException e) {
-
- throw new RuntimeException(e);
- }
- }
-
- private static class URLMatchingGlobbedPathVisitor extends SimpleFileVisitor<Path> {
-
- private final Set<URL> matches;
-
- private final PathMatcher matcher;
-
- public URLMatchingGlobbedPathVisitor(String glob) {
- this.matches = new HashSet<URL>();
- this.matcher = FileSystems.getDefault()
- .getPathMatcher(String.format("glob:%s", glob));
- }
-
- @Override
- public FileVisitResult visitFile(Path file,
- BasicFileAttributes attrs) throws IOException {
-
- if (matcher.matches(file) && Files.isReadable(file)) {
- if (DEBUG) {
- System.out.format("path: %s %n", file);
- }
- matches.add(file.toUri().toURL());
- }
-
- return FileVisitResult.CONTINUE;
- }
-
- public Set<URL> getMatches() {
- return matches;
- }
- }
-}
@@ -65,7 +65,15 @@ cd "`dirname \"$PRG\"`/../../.."
APP_HOME="`pwd -P`"
cd "$SAVED"
-CLASSPATH=$APP_HOME/vertx-boot/build/libs/vertx-boot.jar
+CLASSPATH=$APP_HOME/vertx-core/build/libs/*:$APP_HOME/vertx-platform/build/libs/*:$APP_HOME/vertx-core/build/deps/compile/*:\
+$APP_HOME/vertx-lang/vertx-lang-groovy/build/deps/compile/*:$APP_HOME/vertx-lang/vertx-lang-java/build/deps/compile/*:\
+$APP_HOME/vertx-lang/vertx-lang-jruby/build/deps/compile/*:$APP_HOME/vertx-lang/vertx-lang-jython/build/deps/compile/*:\
+$APP_HOME/vertx-lang/vertx-lang-rhino/build/deps/compile/*:\
+$APP_HOME/vertx-lang/vertx-lang-groovy/build/libs/*:$APP_HOME/vertx-lang/vertx-lang-java/build/libs/*:\
+$APP_HOME/vertx-lang/vertx-lang-jruby/build/libs/*:$APP_HOME/vertx-lang/vertx-lang-jython/build/libs/*:\
+$APP_HOME/vertx-lang/vertx-lang-rhino/build/libs/*
+
+echo $APP_HOME
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
@@ -164,4 +172,4 @@ function splitJvmOpts() {
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $VERTX_OPTS
-exec "$JAVACMD" "${JVM_OPTS[@]}" -Dvertx.install=$APP_HOME -Dvertx.conf=$APP_HOME/vertx-examples/src/main/vertx-dev.properties -Djava.util.logging.config.file=$APP_HOME/src/dist/conf/logging.properties -Djruby.home=$JRUBY_HOME -Djython.home=$JYTHON_HOME -classpath "$CLASSPATH" org.vertx.java.boot.VertxBoot "$@"
+exec "$JAVACMD" "${JVM_OPTS[@]}" -Dvertx.install=$APP_HOME -Djava.util.logging.config.file=$APP_HOME/src/dist/conf/logging.properties -Djruby.home=$JRUBY_HOME -Djython.home=$JYTHON_HOME -classpath "$CLASSPATH" c "$@"
@@ -1,21 +0,0 @@
-#
-# Copyright 2011 the original author or authors.
-#
-# Licensed 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.
-#
-vertx.version=0.0.0-DEBUG
-vertx.name=vert.x
-vertx.description=Effortless asynchronous application development for the modern web and enterprise
-vertx.main=org.vertx.java.deploy.impl.cli.Starter
-vertx.libs=${vertx.install}/vertx-lang/*/build/libs/*.jar,${vertx.install}/vertx-core/build/classes/main,${vertx.install}/vertx-platform/build/classes/main,${vertx.install}/vertx-examples/build/deps/compile/*.jar,${vertx.install}/src/dist/conf
-vertx.temp=${vertx.install}/temp
Oops, something went wrong.

0 comments on commit f9b593d

Please sign in to comment.