mirror of
https://github.com/Smallhacker/disbrowser.git
synced 2025-01-28 02:31:16 +00:00
Moving to multitarget Gradle project
This commit is contained in:
parent
19424abe28
commit
f0bd8d5170
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,3 +1,3 @@
|
||||
/.idea
|
||||
/target
|
||||
/src/main/resources/public/disbrowser.*
|
||||
/src/jvmMain/resources/public/disbrowser.*
|
57
build.gradle
Normal file
57
build.gradle
Normal file
@ -0,0 +1,57 @@
|
||||
plugins {
|
||||
id 'kotlin-multiplatform' version '1.3.11'
|
||||
}
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
kotlin {
|
||||
targets {
|
||||
fromPreset(presets.jvm, 'jvm')
|
||||
fromPreset(presets.js, 'js')
|
||||
}
|
||||
sourceSets {
|
||||
commonMain {
|
||||
dependencies {
|
||||
implementation 'org.jetbrains.kotlin:kotlin-stdlib-common'
|
||||
}
|
||||
}
|
||||
commonTest {
|
||||
dependencies {
|
||||
implementation 'org.jetbrains.kotlin:kotlin-test-common'
|
||||
implementation 'org.jetbrains.kotlin:kotlin-test-annotations-common'
|
||||
}
|
||||
}
|
||||
jvmMain {
|
||||
dependencies {
|
||||
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
|
||||
implementation 'com.fasterxml.jackson.core:jackson-core:2.9.8'
|
||||
implementation 'com.fasterxml.jackson.core:jackson-databind:2.9.8'
|
||||
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.9.8'
|
||||
implementation 'com.fasterxml.jackson.module:jackson-module-kotlin:2.9.8'
|
||||
implementation 'org.glassfish.jersey.containers:jersey-container-grizzly2-http:2.27'
|
||||
implementation 'org.glassfish.jersey.inject:jersey-hk2:2.27'
|
||||
|
||||
}
|
||||
languageSettings {
|
||||
enableLanguageFeature('InlineClasses')
|
||||
useExperimentalAnnotation('kotlin.ExperimentalUnsignedTypes')
|
||||
}
|
||||
}
|
||||
jvmTest {
|
||||
dependencies {
|
||||
implementation 'org.jetbrains.kotlin:kotlin-test'
|
||||
implementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
||||
}
|
||||
}
|
||||
jsMain {
|
||||
dependencies {
|
||||
implementation 'org.jetbrains.kotlin:kotlin-stdlib-js'
|
||||
}
|
||||
}
|
||||
jsTest {
|
||||
dependencies {
|
||||
implementation 'org.jetbrains.kotlin:kotlin-test-js'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
1
gradle.properties
Normal file
1
gradle.properties
Normal file
@ -0,0 +1 @@
|
||||
kotlin.code.style=official
|
159
pom.xml
159
pom.xml
@ -1,159 +0,0 @@
|
||||
<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>
|
||||
|
||||
<groupId>com.smallhacker.disbrowser</groupId>
|
||||
<artifactId>disbrowser</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>disbrowser</name>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.glassfish.jersey</groupId>
|
||||
<artifactId>jersey-bom</artifactId>
|
||||
<version>${jersey.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-core</artifactId>
|
||||
<version>${jackson.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>${jackson.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
<version>${jackson.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.module</groupId>
|
||||
<artifactId>jackson-module-kotlin</artifactId>
|
||||
<version>${jackson.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.glassfish.jersey.containers</groupId>
|
||||
<artifactId>jersey-container-grizzly2-http</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.glassfish.jersey.inject</groupId>
|
||||
<artifactId>jersey-hk2</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- uncomment this to get JSON support:
|
||||
<dependency>
|
||||
<groupId>org.glassfish.jersey.media</groupId>
|
||||
<artifactId>jersey-media-json-binding</artifactId>
|
||||
</dependency>
|
||||
-->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.9</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-stdlib-jdk8</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-test</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.2.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>java</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<mainClass>com.smallhacker.disbrowser.Main</mainClass>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-maven-plugin</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>compile</id>
|
||||
<phase>compile</phase>
|
||||
<goals>
|
||||
<goal>compile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>test-compile</id>
|
||||
<phase>test-compile</phase>
|
||||
<goals>
|
||||
<goal>test-compile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<jvmTarget>1.8</jvmTarget>
|
||||
<args>
|
||||
<arg>-XXLanguage:+InlineClasses</arg>
|
||||
<arg>-Xexperimental=kotlin.ExperimentalUnsignedTypes</arg>
|
||||
</args>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>compile</id>
|
||||
<phase>compile</phase>
|
||||
<goals>
|
||||
<goal>compile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>testCompile</id>
|
||||
<phase>test-compile</phase>
|
||||
<goals>
|
||||
<goal>testCompile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<inherited>true</inherited>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<properties>
|
||||
<jersey.version>2.27</jersey.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<kotlin.version>1.3.11</kotlin.version>
|
||||
<jackson.version>2.9.8</jackson.version>
|
||||
</properties>
|
||||
</project>
|
11
settings.gradle
Normal file
11
settings.gradle
Normal file
@ -0,0 +1,11 @@
|
||||
pluginManagement {
|
||||
resolutionStrategy {
|
||||
eachPlugin {
|
||||
if (requested.id.id == "kotlin-multiplatform") {
|
||||
useModule("org.jetbrains.kotlin:kotlin-gradle-plugin:${requested.version}")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
rootProject.name = 'disbrowser'
|
||||
|
@ -66,10 +66,14 @@ private class HtmlTextNode(private val text: String): HtmlNode {
|
||||
}
|
||||
|
||||
private object ParentBuilder {
|
||||
operator fun getValue(a: HtmlArea, b: KProperty<*>) = ParentHtmlElement(b.name).appendTo(a.parent)
|
||||
operator fun getValue(a: HtmlArea, b: KProperty<*>) = ParentHtmlElement(
|
||||
b.name
|
||||
).appendTo(a.parent)
|
||||
}
|
||||
private object LeafBuilder {
|
||||
operator fun getValue(a: HtmlArea, b: KProperty<*>) = HtmlElement(b.name).appendTo(a.parent)
|
||||
operator fun getValue(a: HtmlArea, b: KProperty<*>) = HtmlElement(
|
||||
b.name
|
||||
).appendTo(a.parent)
|
||||
}
|
||||
|
||||
fun htmlFragment(inner: InnerHtml = {}) = object : HtmlNode {
|
||||
@ -108,7 +112,9 @@ val HtmlArea.button by ParentBuilder
|
||||
fun HtmlNode.appendTo(node: HtmlNode) = apply { node.append(this) }
|
||||
fun HtmlNode.addClass(c: String?) = attrAdd("class", c)
|
||||
val HtmlNode.inner get() = this
|
||||
operator fun HtmlNode.invoke(inner: InnerHtml): HtmlNode = append(htmlFragment(inner))
|
||||
operator fun HtmlNode.invoke(inner: InnerHtml): HtmlNode = append(
|
||||
htmlFragment(inner)
|
||||
)
|
||||
|
||||
fun HtmlNode.attr(key: String, value: String?, inner: InnerHtml) = attr(key, value).inner(inner)
|
||||
fun HtmlNode.addClass(c: String?, inner: InnerHtml) = addClass(c).inner(inner)
|
@ -15,7 +15,8 @@ fun <T> immStack(): ImmStack<T> {
|
||||
return EmptyImmStack as ImmStack<T>
|
||||
}
|
||||
|
||||
private class ImmStackImpl<E>(private val parent: ImmStack<E>, override val top: E): ImmStack<E> {
|
||||
private class ImmStackImpl<E>(private val parent: ImmStack<E>, override val top: E):
|
||||
ImmStack<E> {
|
||||
override fun isEmpty() = false
|
||||
|
||||
override fun pop(): ImmStack<E> = parent
|
@ -111,7 +111,7 @@ object Disassembler {
|
||||
.forEach { tryAddFatal(it.address) }
|
||||
|
||||
while (fatalQueue.isNotEmpty()) {
|
||||
val badAddress = fatalQueue.removeNext()!!
|
||||
val badAddress = fatalQueue.removeNext()
|
||||
val instruction = instructionMap[badAddress] ?: continue
|
||||
val mnemonic = instruction.opcode.mnemonic
|
||||
if (mnemonic == Mnemonic.JSL || mnemonic == Mnemonic.JSR) continue
|
@ -3,7 +3,6 @@ package com.smallhacker.disbrowser.resource
|
||||
import com.smallhacker.disbrowser.Service
|
||||
import com.smallhacker.disbrowser.asm.SnesAddress
|
||||
import com.smallhacker.disbrowser.asm.MetadataLine
|
||||
import com.smallhacker.disbrowser.game.GameSource
|
||||
import com.smallhacker.disbrowser.game.getGameSource
|
||||
import javax.ws.rs.Consumes
|
||||
import javax.ws.rs.POST
|
Loading…
x
Reference in New Issue
Block a user