Skip to content

Commit

Permalink
Create standalone archive for Windows and Linux
Browse files Browse the repository at this point in the history
Windows has been tested and Works, JRE included. Linux is yet untested
and does not come with a JRE.

Fixes #855
Prepares #856
  • Loading branch information
micheljung committed Apr 6, 2018
1 parent 56b6c46 commit 9a3c3c3
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 30 deletions.
23 changes: 13 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def buildAssetList() {
return file("build/install4j").list(new FilenameFilter() {
@Override
boolean accept(File dir, String name) {
return name =~ /\.exe/
return name =~ /\.(exe|zip|tar\.gz|rpm|deb)/
}
}).collect({ file -> "build/install4j/${file}" })
}
Expand Down Expand Up @@ -153,7 +153,6 @@ distributions {
from {
[
configurations.runtime,
file('src/main/native'),
jar,
unpackIceAdapter.outputs.files,
downloadIceAdapterLinux.outputs.files,
Expand All @@ -172,8 +171,9 @@ install4j {
}
}

task buildInstaller(type: Install4jTask) {
description 'Creates the application installer using Install4j'
task buildInstall4jMediaFiles(type: Install4jTask) {
group "distribution"
description 'Creates install4j media files'
dependsOn 'clean'
dependsOn 'jar'
dependsOn 'installDist'
Expand All @@ -189,8 +189,9 @@ task buildInstaller(type: Install4jTask) {
}

task githubRelease(type: ReleaseTask, overwrite: true) {
group "distribution"
description 'Creates a new release on Github and closes the according milestone'
dependsOn 'buildInstaller'
dependsOn 'buildInstall4jMediaFiles'

doFirst {
project.github {
Expand All @@ -207,12 +208,14 @@ task githubRelease(type: ReleaseTask, overwrite: true) {
}

task downloadIceAdapter(type: Download) {
group "native dependencies"
src "https://github.com/FAForever/ice-adapter/releases/download/v${faf_ice_adapter_version}/faf-ice-adapter-win32.zip"
dest file("${buildDir}/tmp/faf-ice-adapter.zip")
onlyIfNewer true
}

task downloadIceAdapterLinux(type: Download) {
group "native dependencies"
src "https://github.com/FAForever/ice-adapter/releases/download/v${faf_ice_adapter_version}/faf-ice-adapter"
dest file("${buildDir}/resources/native/faf-ice-adapter")
onlyIfNewer true
Expand All @@ -224,17 +227,17 @@ task unpackIceAdapter(type: Copy, dependsOn: downloadIceAdapter) {
into file("${buildDir}/resources/native")
}

task downloadUnixUid(type: Download, dependsOn: unpackIceAdapter) {
task downloadUnixUid(type: Download) {
group "native dependencies"
src "https://github.com/FAForever/uid/releases/download/v${faf_uid_version}/faf-uid"
dest file("${buildDir}/resources/native")
dest file("${buildDir}/resources/native/faf-uid")
onlyIfNewer true
}

task downloadWindowsUid(type: Download, dependsOn: unpackIceAdapter) {
task downloadWindowsUid(type: Download) {
group "native dependencies"
src "https://github.com/FAForever/uid/releases/download/v${faf_uid_version}/faf-uid.exe"
dest file("${buildDir}/resources/native")
dest file("${buildDir}/resources/native/faf-uid.exe")
onlyIfNewer true
}

Expand All @@ -243,7 +246,7 @@ task downloadNativeDependencies(dependsOn: [unpackIceAdapter, downloadUnixUid, d
}

task wrapper(type: Wrapper) {
gradleVersion = '2.5'
gradleVersion = '4.5.1'
}

task sendCoverageToCodacy(type: JavaExec, dependsOn: jacocoTestReport) {
Expand Down
109 changes: 89 additions & 20 deletions downlords-faf-client.install4j
Original file line number Diff line number Diff line change
Expand Up @@ -353,26 +353,7 @@ return console.askOkCancel(message, true);
<validation />
<preActivation />
<postActivation />
<actions>
<action name="" id="162" customizedId="" beanClass="com.install4j.runtime.beans.actions.desktop.CreateFileAssociationAction" enabled="true" commentSet="false" comment="" actionElevationType="elevated" rollbackBarrier="false" rollbackBarrierExitCode="1" multiExec="false" failureStrategy="1" errorMessage="">
<serializedBean>
<java class="java.beans.XMLDecoder">
<object class="com.install4j.runtime.beans.actions.desktop.CreateFileAssociationAction">
<void property="description">
<string>Forged Alliance Forever Replay</string>
</void>
<void property="extension">
<string>fafreplay</string>
</void>
<void property="launcherId">
<string>25</string>
</void>
</object>
</java>
</serializedBean>
<condition />
</action>
</actions>
<actions />
<formComponents>
<formComponent name="" id="164" customizedId="" beanClass="com.install4j.runtime.beans.formcomponents.MultilineLabelComponent" enabled="true" commentSet="false" comment="" insetTop="" insetLeft="" insetBottom="" insetRight="" resetInitOnPrevious="false" useExternalParametrization="false" externalParametrizationName="" externalParametrizationMode="all">
<serializedBean>
Expand Down Expand Up @@ -1204,6 +1185,94 @@ return console.askYesNo(message, true);
<customAttributes />
</autoUpdate>
</windows>
<windowsArchive name="Windows Archive" id="330" customizedId="" mediaFileName="" installDir="downlords-faf-client-${compiler:sys.version}" overridePrincipalLanguage="false" jreBitType="32" runPostProcessor="false" postProcessor="" failOnPostProcessorError="false" useLegacyMediaFileIds="false" legacyMediaFileIds="" downloadURL="" includeAllDownloadableComponents="true" includedJRE="windows-x86-1.8.0_162" manualJREEntry="false">
<excludedComponents />
<includedDownloadableComponents />
<excludedLaunchers />
<excludedBeans />
<overriddenPrincipalLanguage id="en" customLocalizationFile="" />
<exclude>
<entry location="lib/faf-ice-adapter" fileType="regular" />
<entry location="lib/faf-uid" fileType="regular" />
</exclude>
<variables />
<autoUpdate useMinUpdatableVersion="false" minUpdatableVersion="" useMaxUpdatableVersion="false" maxUpdatableVersion="">
<commentFiles />
<customAttributes />
</autoUpdate>
</windowsArchive>
<unixArchive name="Unix Archive" id="331" customizedId="" mediaFileName="" installDir="downlords-faf-client-${compiler:sys.version}" overridePrincipalLanguage="false" jreBitType="all" runPostProcessor="false" postProcessor="" failOnPostProcessorError="false" useLegacyMediaFileIds="false" legacyMediaFileIds="" downloadURL="" includeAllDownloadableComponents="true" includedJRE="" manualJREEntry="false">
<excludedComponents />
<includedDownloadableComponents />
<excludedLaunchers />
<excludedBeans />
<overriddenPrincipalLanguage id="en" customLocalizationFile="" />
<exclude>
<entry location="lib/faf-ice-adapter.exe" fileType="regular" />
<entry location="lib/faf-uid.exe" fileType="regular" />
</exclude>
<variables />
<autoUpdate useMinUpdatableVersion="false" minUpdatableVersion="" useMaxUpdatableVersion="false" maxUpdatableVersion="">
<commentFiles />
<customAttributes />
</autoUpdate>
</unixArchive>
<linuxRPM name="Linux RPM" id="332" customizedId="" mediaFileName="" installDir="/opt/downlords-faf-client-${compiler:sys.version}" overridePrincipalLanguage="false" jreBitType="all" runPostProcessor="false" postProcessor="" failOnPostProcessorError="false" useLegacyMediaFileIds="false" legacyMediaFileIds="" downloadURL="" includeAllDownloadableComponents="true" includedJRE="" manualJREEntry="false" overwriteNeverAsConfigFiles="false" os="linux" arch="i386">
<excludedComponents />
<includedDownloadableComponents />
<excludedLaunchers />
<excludedBeans />
<overriddenPrincipalLanguage id="en" customLocalizationFile="" />
<exclude>
<entry location="lib/faf-ice-adapter.exe" fileType="regular" />
<entry location="lib/faf-uid.exe" fileType="regular" />
</exclude>
<variables />
<autoUpdate useMinUpdatableVersion="false" minUpdatableVersion="" useMaxUpdatableVersion="false" maxUpdatableVersion="">
<commentFiles />
<customAttributes />
</autoUpdate>
<preInstallScript mode="1" file="">
<content />
</preInstallScript>
<postInstallScript mode="1" file="">
<content />
</postInstallScript>
<preUninstallScript mode="1" file="">
<content />
</preUninstallScript>
<postUninstallScript mode="1" file="">
<content />
</postUninstallScript>
</linuxRPM>
<linuxDeb name="Linux Deb Archive" id="333" customizedId="" mediaFileName="" installDir="/opt/downlords-faf-client-${compiler:sys.version}" overridePrincipalLanguage="false" jreBitType="all" runPostProcessor="false" postProcessor="" failOnPostProcessorError="false" useLegacyMediaFileIds="false" legacyMediaFileIds="" downloadURL="" includeAllDownloadableComponents="true" includedJRE="" manualJREEntry="false" overwriteNeverAsConfigFiles="false" bzip="false" description="Downlord's FAF Client" dependencies="oracle-java8-installer" maintainerEmail="michel.jung89@gmail.com" architectureSet="false" architecture="">
<excludedComponents />
<includedDownloadableComponents />
<excludedLaunchers />
<excludedBeans />
<overriddenPrincipalLanguage id="en" customLocalizationFile="" />
<exclude>
<entry location="lib/faf-ice-adapter.exe" fileType="regular" />
<entry location="lib/faf-uid.exe" fileType="regular" />
</exclude>
<variables />
<autoUpdate useMinUpdatableVersion="false" minUpdatableVersion="" useMaxUpdatableVersion="false" maxUpdatableVersion="">
<commentFiles />
<customAttributes />
</autoUpdate>
<preInstallScript mode="1" file="">
<content />
</preInstallScript>
<postInstallScript mode="1" file="">
<content />
</postInstallScript>
<preUninstallScript mode="1" file="">
<content />
</preUninstallScript>
<postUninstallScript mode="1" file="">
<content />
</postUninstallScript>
</linuxDeb>
</mediaSets>
<buildIds buildAll="true" />
<buildOptions verbose="false" faster="false" disableSigning="false" disableJreBundling="false" debug="false" />
Expand Down
Binary file removed src/main/native/uid
Binary file not shown.
Binary file removed src/main/native/uid.exe
Binary file not shown.

0 comments on commit 9a3c3c3

Please sign in to comment.