Permalink
Browse files

replaced ant with gradle

git-svn-id: http://svn.code.sf.net/p/upnp-portmapper/code/branches/gradle@113 2bd42da9-18a5-434a-ad8e-d1ed5d6a128d
  • Loading branch information...
1 parent 2876610 commit d2b8a12f28aa89fcc8b2e9d61735a3106857a82a christoph committed Jul 14, 2013
View
@@ -3,34 +3,11 @@
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="src_weupnp"/>
<classpathentry kind="src" path="test"/>
+ <classpathentry kind="src" path="resources"/>
+ <classpathentry kind="con" path="GROOVY_DSL_SUPPORT"/>
+ <classpathentry kind="con" path="GROOVY_SUPPORT"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="lib" path="lib/commons-jxpath-1.1.jar"/>
- <classpathentry kind="lib" path="lib/commons-logging.jar"/>
- <classpathentry kind="lib" path="lib/log4j-1.2.15.jar">
- <attributes>
- <attribute name="javadoc_location" value="http://logging.apache.org/log4j/1.2/apidocs/"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="lib" path="lib/sbbi-upnplib-1.0.4.jar" sourcepath="/SBBI UPnP/src"/>
- <classpathentry kind="lib" path="lib/AppFramework-1.03.jar" sourcepath="lib/source/AppFramework-1.03-src.zip">
- <attributes>
- <attribute name="javadoc_location" value="https://appframework.dev.java.net/nonav/javadoc/AppFramework-1.03"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="lib" path="lib/swing-worker.jar"/>
- <classpathentry kind="lib" path="lib/BrowserLauncher2-1_3.jar">
- <attributes>
- <attribute name="javadoc_location" value="http://browserlaunch2.sourceforge.net/api"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="lib" path="lib/miglayout-3.7.2.jar"/>
- <classpathentry kind="lib" path="lib/commons-cli-1.2.jar" sourcepath="lib/source/commons-cli-1.2-sources.jar">
- <attributes>
- <attribute name="javadoc_location" value="http://commons.apache.org/cli/api-release/"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="lib" path="lib/test/hamcrest-core-1.3.jar" sourcepath="lib/source/hamcrest-core-1.3-sources.jar"/>
- <classpathentry kind="lib" path="lib/test/junit-4.11.jar" sourcepath="lib/source/junit-4.11-sources.jar"/>
- <classpathentry kind="lib" path="lib/test/mockito-all-1.9.5.jar" sourcepath="lib/test/mockito-all-1.9.5.jar"/>
+ <classpathentry exported="true" kind="con" path="org.springsource.ide.eclipse.gradle.classpathcontainer"/>
+ <classpathentry kind="con" path="org.springsource.ide.eclipse.gradle.dsld.classpathcontainer"/>
<classpathentry kind="output" path="bin"/>
</classpath>
View
@@ -12,6 +12,8 @@
</buildCommand>
</buildSpec>
<natures>
+ <nature>org.springsource.ide.eclipse.gradle.core.nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.jdt.groovy.core.groovyNature</nature>
</natures>
</projectDescription>
@@ -0,0 +1,4 @@
+#org.springsource.ide.eclipse.gradle.core.preferences.GradleProjectPreferences
+#Sun Jul 14 14:23:32 CEST 2013
+org.springsource.ide.eclipse.gradle.linkedresources=
+org.springsource.ide.eclipse.gradle.rootprojectloc=
@@ -0,0 +1,3 @@
+#org.springsource.ide.eclipse.gradle.core.actions.GradleRefreshPreferences
+#Sun Jul 14 14:23:33 CEST 2013
+enableDSLD=true
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+groovy.compiler.level=20
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
View
@@ -0,0 +1,35 @@
+apply plugin: 'java'
+apply plugin:'application'
+
+mainClassName = 'org.chris.portmapper.PortMapperStarter'
+
+sourceSets {
+ main {
+ java {
+ srcDir 'src'
+ srcDir 'src_weupnp'
+ }
+ resources { srcDir 'resources' }
+ }
+ test {
+ java { srcDir 'test' }
+ }
+}
+
+repositories {
+ flatDir { dirs 'lib' }
+ mavenCentral()
+}
+
+dependencies {
+ testCompile 'junit:junit:4.11'
+ testCompile 'org.mockito:mockito-core:1.9.5'
+ compile 'commons-cli:commons-cli:1.2'
+ compile 'log4j:log4j:1.2.17'
+ compile 'commons-logging:commons-logging-api:1.1'
+ compile 'com.miglayout:miglayout:3.7.4'
+ compile 'net.java.dev.appframework:appframework:1.03'
+ compile 'edu.stanford.ejalbert:BrowserLauncher2:1.3'
+ compile ':sbbi-upnplib:1.0.4'
+ runtime 'commons-jxpath:commons-jxpath:1.1' // sbbi
+}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
View
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
View
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
@@ -21,8 +21,8 @@
import org.chris.portmapper.logging.LogMessageListener;
import org.chris.portmapper.logging.LogMessageWriter;
import org.chris.portmapper.model.PortMappingPreset;
-import org.chris.portmapper.router.IRouter;
import org.chris.portmapper.router.AbstractRouterFactory;
+import org.chris.portmapper.router.IRouter;
import org.chris.portmapper.router.RouterException;
import org.jdesktop.application.ResourceMap;
import org.jdesktop.application.SingleFrameApplication;
@@ -62,13 +62,13 @@ protected void startup() {
loadSettings();
- PortMapperView view = new PortMapperView();
+ final PortMapperView view = new PortMapperView();
addExitListener(new ExitListener() {
- public boolean canExit(EventObject arg0) {
+ public boolean canExit(final EventObject arg0) {
return true;
}
- public void willExit(EventObject arg0) {
+ public void willExit(final EventObject arg0) {
disconnectRouter();
}
});
@@ -84,13 +84,13 @@ public void willExit(EventObject arg0) {
* the current directory, use this as the configuration directory.
*/
private void setCustomConfigDir() {
- String customConfigurationDir = System
+ final String customConfigurationDir = System
.getProperty(CONFIG_DIR_PROPERTY_NAME);
- File portableAppConfigDir = new File("PortMapperConf");
+ final File portableAppConfigDir = new File("PortMapperConf");
// the property is set: check, if the given directory can be used
if (customConfigurationDir != null) {
- File dir = new File(customConfigurationDir);
+ final File dir = new File(customConfigurationDir);
if (!dir.isDirectory()) {
logger.error("Custom configuration directory '"
+ customConfigurationDir + "' is not a directory.");
@@ -131,7 +131,7 @@ private void loadSettings() {
try {
settings = (Settings) getContext().getLocalStorage().load(
SETTINGS_FILENAME);
- } catch (IOException e) {
+ } catch (final IOException e) {
logger.warn("Could not load settings from file", e);
}
@@ -145,13 +145,14 @@ private void loadSettings() {
}
private void initTextAreaLogger() {
- WriterAppender writerAppender = (WriterAppender) Logger.getLogger(
- "org.chris.portmapper").getAppender("jtextarea");
+ final WriterAppender writerAppender = (WriterAppender) Logger
+ .getLogger("org.chris.portmapper").getAppender("jtextarea");
logWriter = new LogMessageWriter();
+ // FIXME: null check
writerAppender.setWriter(logWriter);
}
- public void setLogMessageListener(LogMessageListener listener) {
+ public void setLogMessageListener(final LogMessageListener listener) {
this.logWriter.registerListener(listener);
}
@@ -161,14 +162,14 @@ protected void shutdown() {
logger.debug("Saving settings " + settings + " to file "
+ SETTINGS_FILENAME);
if (logger.isTraceEnabled()) {
- for (PortMappingPreset preset : settings.getPresets()) {
+ for (final PortMappingPreset preset : settings.getPresets()) {
logger.trace("Saving port mapping "
+ preset.getCompleteDescription());
}
}
try {
getContext().getLocalStorage().save(settings, SETTINGS_FILENAME);
- } catch (IOException e) {
+ } catch (final IOException e) {
logger.warn("Could not save settings to file", e);
}
}
@@ -194,7 +195,7 @@ public void connectRouter() throws RouterException {
AbstractRouterFactory routerFactory;
try {
routerFactory = createRouterFactory();
- } catch (RouterException e) {
+ } catch (final RouterException e) {
logger.error("Could not create router factory", e);
return;
}
@@ -241,9 +242,9 @@ private AbstractRouterFactory createRouterFactory() throws RouterException {
logger.info("Creating router factory for class "
+ settings.getRouterFactoryClassName());
try {
- routerFactoryClass = (Class<AbstractRouterFactory>) Class.forName(settings
- .getRouterFactoryClassName());
- } catch (ClassNotFoundException e1) {
+ routerFactoryClass = (Class<AbstractRouterFactory>) Class
+ .forName(settings.getRouterFactoryClassName());
+ } catch (final ClassNotFoundException e1) {
throw new RouterException(
"Did not find router factory class for name "
+ settings.getRouterFactoryClassName(), e1);
@@ -254,7 +255,7 @@ private AbstractRouterFactory createRouterFactory() throws RouterException {
+ routerFactoryClass);
try {
routerFactory = routerFactoryClass.newInstance();
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new RouterException(
"Could not create a router factory for name "
+ settings.getRouterFactoryClassName(), e);
@@ -313,7 +314,7 @@ public String getLocalHostAddress() {
logger.warn("Did not get IP of localhost from network interface");
}
- } catch (RouterException e) {
+ } catch (final RouterException e) {
logger.warn("Could not get address of localhost.", e);
logger.warn("Could not get address of localhost. Please enter it manually.");
}
@@ -330,7 +331,7 @@ private InetAddress getLocalhostAddressFromNetworkInterface()
final List<NetworkInterface> networkInterfaces = Collections
.list(NetworkInterface.getNetworkInterfaces());
logger.trace("Found network interfaces " + networkInterfaces);
- for (NetworkInterface nInterface : networkInterfaces) {
+ for (final NetworkInterface nInterface : networkInterfaces) {
if (nInterface.isLoopback()) {
logger.debug("Found loopback network interface "
+ nInterface.getDisplayName() + "/"
@@ -365,13 +366,13 @@ private InetAddress getLocalhostAddressFromNetworkInterface()
+ " has no addresses.");
}
}
- } catch (SocketException e) {
+ } catch (final SocketException e) {
throw new RouterException("Did not get network interfaces.", e);
}
return null;
}
- public void setLogLevel(String logLevel) {
+ public void setLogLevel(final String logLevel) {
Logger.getLogger("org.chris.portmapper").setLevel(
Level.toLevel(logLevel));
}

0 comments on commit d2b8a12

Please sign in to comment.