Skip to content

Commit

Permalink
Merge pull request #26 from crocs-muni/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
Aiosa authored Jul 24, 2021
2 parents ae3d1b6 + 2961fb0 commit 35e810a
Show file tree
Hide file tree
Showing 57 changed files with 966 additions and 509 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
*.rar

# Garbage
.idea
.gradle
build
log
Expand Down
11 changes: 11 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

103 changes: 50 additions & 53 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import edu.sc.seis.launch4j.tasks.Launch4jLibraryTask


plugins {
id 'java'
id 'edu.sc.seis.launch4j' version '2.4.6'
id 'com.bmuschko.izpack' version '3.0'
}

group 'cz.muni.crocs.appletstore'
project.version = '1.3'
project.version = '' //avoid versions in filenames
sourceCompatibility = 1.11
tasks.withType(JavaCompile) { options.encoding = 'UTF-8' }

Expand Down Expand Up @@ -51,7 +51,6 @@ dependencies {
compile group: 'org.ini4j', name: 'ini4j', version: '0.5.4'
compile group: 'com.googlecode.concurrent-trees', name: 'concurrent-trees', version: '2.6.1'
implementation 'edu.sc.seis.gradle:launch4j:2.4.6'
izpack 'org.codehaus.izpack:izpack-dist:5.1.3'

// gradle javafx plugin addds the javafx as module path dependency, not classpath
compile "org.openjfx:javafx-base:11:${platform}"
Expand All @@ -60,80 +59,75 @@ dependencies {
compile "org.openjfx:javafx-media:11:${platform}"
compile "org.openjfx:javafx-swing:11:${platform}"
compile "org.openjfx:javafx-web:11:${platform}"


}

///////////////////////////
//tasks meant to be executed
///////////////////////////

task windowsDeployment(type: Launch4jLibraryTask, dependsOn: izPackCreateInstaller) {
outputDir="deploy-win"
jar = "JCAppStore-${project.version}-win.jar"
outfile = "JCAppStore-${project.version}-win.exe"

headerType = "gui"
manifest = "../../installer-win/launch4j/manifest.mf"
icon="../../src/main/resources/img/icon.ico"
copyConfigurable = []
}

task unixDeployment(dependsOn: jar) {
//note if this task fails for you, just run the script manually (from the folder the script is in)
if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) {
println "Unable to run on Windows."
return 1
}

exec {
commandLine "${projectDir}/installer-unix/targenerator.sh"
//copy files to be prepared for InstallBuilder: UNIX-like platforms
task prepareInstallBuilderForUNIX(dependsOn: jar) {
//generate folders deploy, out, res, main
doFirst {
def folder = file("$buildDir/deploy-unix/src/main/resources")
if( !folder.exists() ) {
folder.mkdirs()
}
}
}

///////////////////////////
// izpack installer
///////////////////////////
doLast {
copy {
from "src/main/resources"
into "$buildDir/deploy-unix/src/main/resources"
}

izpack {
baseDir = file("$buildDir/deploy-win")
installFile = file('installer-win/installer.xml')
outputFile = file("$buildDir/deploy-win/JCAppStore-${project.version}-win.jar")
compression = 'deflate'
compressionLevel = 9
appProperties = ['app.group': 'CRoCS', 'app.name': 'jcAppStore', 'app.title': 'JCAppStore',
'app.version': project.version, 'app.subpath': "JCAppStore-${project.version}"]
copy {
from file(jar.archiveFile)
into file("$buildDir/deploy-unix")
}
}
}
izPackCreateInstaller.dependsOn 'prepareIzPack'

task prepareIzPack(dependsOn: 'createAppExe') {
//copy files to be prepared for InstallBuilder: Windows
task prepareInstallBuilderForWin(dependsOn: 'createAppExe') {
//generate folders deploy, out, res, main
doFirst {
def folder = file("$buildDir/deploy-win/out/src/main/resources")
def folder = file("$buildDir/deploy-win/src/main/resources")
if( !folder.exists() ) {
folder.mkdirs()
}

def scripts = file("$buildDir/deploy-win/scripts")
if( !scripts.exists() ) {
scripts.mkdirs()
}
}

doLast {
copy {
from "src/main/resources"
into "$buildDir/deploy-win/out/src/main/resources"
into "$buildDir/deploy-win/src/main/resources"
}

copy {
from "installer-win/dependency"
into "$buildDir/deploy-win/scripts"
from file("$buildDir/libs/JCAppStore.exe")
into file("$buildDir/deploy-win")
}
}
}

copy {
from file("$buildDir/libs/JCAppStore-${project.version}.exe")
into file("$buildDir/deploy-win/out")
}
//multipurpose task, preserved for general compatibility: uncomment and run to create tarball
//literally does nothing, just run targenerator.sh manually.
task createUniversalUnixTar(dependsOn: jar) {
//note if this task fails for you, just run the script manually (from the folder the script is in)
if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) {
println "Unable to run on Windows."
return 1
}

//creates problems in unix IDEs when running gradle
// exec {
// commandLine "${projectDir}/installer-unix/targenerator.sh"
// }
}

///////////////////////////
Expand All @@ -142,19 +136,21 @@ task prepareIzPack(dependsOn: 'createAppExe') {

task createAppExe(type: Launch4jLibraryTask, dependsOn: jar) {
outputDir="libs"
jar = "JCAppStore-${project.version}.jar"
outfile = "JCAppStore-${project.version}.exe"
jar = "JCAppStore.jar"
outfile = "JCAppStore.exe"

headerType = "gui"
manifest = "../../installer-win/launch4j/manifest.mf"
//manifest = "../../installer-win/launch4j/manifest.mf"
icon="../../src/main/resources/img/icon.ico"
copyConfigurable = []
}


jar {
archivesBaseName = "JCAppStore"
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }


//do not add certain resources, these are used from external folder instead for better accessibility
//todo move images back to resources and load them from there (not visible from outside)
//todo move lang properties OUTSIDE and make them updateable/modifiable
Expand All @@ -166,6 +162,7 @@ jar {

exclude 'META-INF/*.RSA', 'META-INF/*.SF','META-INF/*.DSA'
manifest {
attributes 'Main-Class': 'cz.muni.crocs.appletstore.SplashScreen'
attributes 'Main-Class': 'cz.muni.crocs.appletstore.SplashScreen',
'Implementation-Title': 'JCAppStore'
}
}
Loading

0 comments on commit 35e810a

Please sign in to comment.