Split Getdown into multiple (Maven) modules.

- core: the main Getdown logic code
- tools: code to create digest.txt & patch files
- launcher: the standalone launcher/updater app
- ant: the Ant task for creating digest.txt files

This paves the way for a proper Jigsaw-ification of the Getdown code.

I may further factor code out of getdown-launcher and into getdown-core to
enable the use-case where an app embeds Getdown completely and does not use the
launcher app/UI. That will also make it easier to create a JavaFX UI and retire
the old Swing UI.

This also moves the obsolete applet code into a separate applet module, which
is merely a temporary holding area. It will be deleted in the next commit.
This commit is contained in:
Michael Bayne
2018-09-04 09:11:29 -07:00
parent 8ff9bf4d68
commit 4c383f99c7
63 changed files with 386 additions and 264 deletions
+28
View File
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.threerings</groupId>
<artifactId>getdown</artifactId>
<version>1.7.2-SNAPSHOT</version>
</parent>
<artifactId>getdown-ant</artifactId>
<packaging>jar</packaging>
<name>Getdown Ant Task</name>
<description>An Ant task for building Getdown app distributions</description>
<dependencies>
<dependency>
<groupId>com.threerings</groupId>
<artifactId>getdown-tools</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.7.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
@@ -0,0 +1,94 @@
//
// Getdown - application installer, patcher and launcher
// Copyright (C) 2004-2016 Getdown authors
// https://github.com/threerings/getdown/blob/master/LICENSE
package com.threerings.getdown.tools;
import java.io.File;
import java.io.IOException;
import java.security.GeneralSecurityException;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
import com.threerings.getdown.data.Digest;
/**
* An ant task used to create a <code>digest.txt</code> for a Getdown
* application deployment.
*/
public class DigesterTask extends Task
{
/**
* Sets the application directory.
*/
public void setAppdir (File appdir)
{
_appdir = appdir;
}
/**
* Sets the digest signing keystore.
*/
public void setKeystore (File path)
{
_storepath = path;
}
/**
* Sets the keystore decryption key.
*/
public void setStorepass (String password)
{
_storepass = password;
}
/**
* Sets the private key alias.
*/
public void setAlias (String alias)
{
_storealias = alias;
}
/**
* Performs the actual work of the task.
*/
@Override
public void execute () throws BuildException
{
// make sure appdir is set
if (_appdir == null) {
throw new BuildException("Must specify the path to the application directory " +
"via the 'appdir' attribute.");
}
// make sure _storepass and _keyalias are set, if _storepath is set
if (_storepath != null && (_storepass == null || _storealias == null)) {
throw new BuildException(
"Must specify both a keystore password and a private key alias.");
}
try {
Digester.createDigests(_appdir, _storepath, _storepass, _storealias);
} catch (IOException ioe) {
throw new BuildException("Error creating digest: " + ioe.getMessage(), ioe);
} catch (GeneralSecurityException gse) {
throw new BuildException("Error creating signature: " + gse.getMessage(), gse);
}
}
/** The application directory in which we're creating a digest file. */
protected File _appdir;
/** The path to the keystore we'll use to sign the digest file, if any. */
protected File _storepath;
/** The decryption key for the keystore. */
protected String _storepass;
/** The private key alias. */
protected String _storealias;
}