Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lure0xaos committed Sep 7, 2022
0 parents commit 47f3b60
Show file tree
Hide file tree
Showing 94 changed files with 4,845 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/build/
/.idea/
/.gradle/
/*/build/
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Xenox
Xonix game implementation
7 changes: 7 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
group = "gargoyle.xenox"
version = "1.0"
description = "xenox"

repositories {
mavenCentral()
}
41 changes: 41 additions & 0 deletions campaign/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
val javaVersion: String = JavaVersion.VERSION_16.toString()

group = "gargoyle.xenox"
version = "1.0"
description = "xenox"

plugins {
`java-library`
kotlin("jvm") version ("1.6.21")

id("org.javamodularity.moduleplugin") version ("1.8.11")
}

repositories {
mavenCentral()
}

dependencies {
implementation(platform(kotlin("bom")))

api(project(":services"))
}

tasks.compileJava {
modularity.inferModulePath.set(true)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
options.encoding = Charsets.UTF_8.toString()
}

tasks.compileKotlin {
destinationDirectory.set(tasks.compileJava.get().destinationDirectory)
targetCompatibility = javaVersion
kotlinOptions {
jvmTarget = javaVersion
}
}

tasks.jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
8 changes: 8 additions & 0 deletions campaign/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module Xenox.campaign {
requires kotlin.stdlib;
requires Xenox.services;

exports gargoyle.xenox.campaign;
provides gargoyle.xenox.info.CampaignInfo with gargoyle.xenox.campaign.TestCampaignInfo;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package gargoyle.xenox.campaign

import gargoyle.xenox.campaign.level1.TestLevelInfo
import gargoyle.xenox.info.CampaignInfo
import gargoyle.xenox.info.LevelInfo

class TestCampaignInfo : CampaignInfo {
override val name: String = "Test"
override val levels: List<LevelInfo> = listOf(TestLevelInfo)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package gargoyle.xenox.campaign.level1

import gargoyle.xenox.info.LevelInfo
import java.net.URL

object TestLevelInfo : LevelInfo {
override val title: String = "Test"
override val balls: Int = 5
override val width: Int = 100
override val height: Int = 50
override val lives: Int = 10
override val percent: Int = 80
override val speed: Int = 50
override val cover: URL? = javaClass.getResource("cover1.jpg")
override val image: URL? = javaClass.getResource("image1.jpg")
override val music: URL? = javaClass.getResource("music1.au")
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
107 changes: 107 additions & 0 deletions game/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
val javaVersion: String = JavaVersion.VERSION_16.toString()

val appMainClass: String = "gargoyle.xenox.Xenox"
val appModule: String = "Xenox"
val appName: String = "Xenox"

val os: org.gradle.internal.os.OperatingSystem = org.gradle.internal.os.OperatingSystem.current()
val appInstallerType: String = "msi"
val appIconIco: String = "game/src/main/resources/gargoyle/xenox/icon.ico"
val appIconPng: String = "game/src/main/resources/gargoyle/xenox/icon.gif"
val appCopyright: String = "Lure of Chaos"
val appVendor: String = "Lure of Chaos"

group = "gargoyle.xenox"
version = "1.0"
description = "xenox"

plugins {
java
application
kotlin("jvm") version ("1.6.21")

id("org.javamodularity.moduleplugin") version ("1.8.11")
id("org.beryx.jlink") version ("2.25.0")
}

repositories {
mavenCentral()
}

dependencies {
constraints {
implementation(kotlin("stdlib-jdk7"))
implementation(kotlin("stdlib-jdk8"))
}
implementation(platform(kotlin("bom")))

implementation(project(":util"))

implementation(project(":services"))
implementation(project(":campaign"))
}

tasks.compileJava {
modularity.inferModulePath.set(true)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
options.encoding = Charsets.UTF_8.toString()
}

tasks.compileKotlin {
destinationDirectory.set(tasks.compileJava.get().destinationDirectory)
targetCompatibility = javaVersion
kotlinOptions {
jvmTarget = javaVersion
}
}

tasks.jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}

tasks.build {
dependsOn += tasks.jpackage
}

application {
mainClass.set(appMainClass)
mainModule.set(appModule)
}

jlink {
options.set(listOf("--strip-debug", "--compress", "2", "--no-header-files", "--no-man-pages"))
launcher {
name = appName
mainClass.set(appMainClass)
}
jpackage {
installerType = appInstallerType
installerName = appName
appVersion = project.version.toString()
if (os.isWindows) {
icon = rootProject.file(appIconIco).path
installerOptions = listOf(
"--description", rootProject.description,
"--copyright", appCopyright,
"--vendor", appVendor,
"--win-dir-chooser",
"--win-menu",
"--win-per-user-install",
"--win-shortcut"
)
}
if (os.isLinux) {
icon = rootProject.file(appIconPng).path
installerOptions = listOf(
"--description", rootProject.description,
"--copyright", appCopyright,
"--vendor", appVendor,
"--linux-shortcut"
)
}
if (os.isMacOsX) {
icon = rootProject.file(appIconPng).path
}
}
}
16 changes: 16 additions & 0 deletions game/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module Xenox {
requires kotlin.stdlib;
requires kotlin.stdlib.jdk7;
requires kotlin.stdlib.jdk8;

requires transitive java.desktop;
requires transitive java.prefs;

requires Xenox.util;

exports gargoyle.xenox;

requires transitive Xenox.services;
requires Xenox.campaign;
uses gargoyle.xenox.info.CampaignInfo;
}
Loading

0 comments on commit 47f3b60

Please sign in to comment.