Skip to content

Commit 473a828

Browse files
committed
CRLF -> LF
1 parent 1e61e53 commit 473a828

File tree

38 files changed

+1569
-1569
lines changed

38 files changed

+1569
-1569
lines changed

ExampleOut/API/exampleAPI.jar

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

ExampleOut/entryPoint.jar

0 Bytes
Binary file not shown.

build.gradle.kts

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
plugins {
2-
kotlin("jvm") version "1.9.10"
3-
}
4-
repositories {
5-
mavenCentral()
6-
gradlePluginPortal()
7-
}
8-
java {
9-
toolchain {
10-
languageVersion.set(JavaLanguageVersion.of(17))
11-
}
12-
}
13-
tasks {
14-
clean {
15-
delete("ExampleOut/")
16-
delete("plugins/")
17-
}
1+
plugins {
2+
kotlin("jvm") version "1.9.10"
3+
}
4+
repositories {
5+
mavenCentral()
6+
gradlePluginPortal()
7+
}
8+
java {
9+
toolchain {
10+
languageVersion.set(JavaLanguageVersion.of(17))
11+
}
12+
}
13+
tasks {
14+
clean {
15+
delete("ExampleOut/")
16+
delete("plugins/")
17+
}
1818
}
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
package examplepluginloader
2-
import kotlin.collections.remove
3-
import java.io.File
4-
import java.lang.reflect.Type
5-
import java.net.URLClassLoader
6-
fun main(args: Array<String>) {
7-
val mutArgs = args.toMutableList()
8-
var mode :Int
9-
try{
10-
mode = Integer.parseInt(args[0])
11-
mutArgs.removeAt(0)
12-
} catch (e: Exception){ mode = 1 }
13-
val apiPath = File(File(
14-
FindLocationOfTheThing::class.java.protectionDomain.codeSource.location.toURI())
15-
.getParent()).toPath().resolve("API").resolve("exampleAPI.jar").toUri().toURL()
16-
val programLocation = File(File(
17-
FindLocationOfTheThing::class.java.protectionDomain.codeSource.location.toURI())
18-
.getParent()).toPath().resolve("MyProgram").resolve("examplepluginloader.jar").toUri().toURL()
19-
val sysloader = URLClassLoader("MySysLoader", arrayOf(apiPath), ClassLoader.getSystemClassLoader())
20-
val programloader = URLClassLoader("MyProgramLoader", arrayOf(programLocation), sysloader)
21-
programloader.loadClass("examplepluginloader.program.MyProgram").getConstructor(List::class.java, Int::class.java).newInstance(mutArgs.toList(), mode)
22-
}
1+
package examplepluginloader
2+
import kotlin.collections.remove
3+
import java.io.File
4+
import java.lang.reflect.Type
5+
import java.net.URLClassLoader
6+
fun main(args: Array<String>) {
7+
val mutArgs = args.toMutableList()
8+
var mode :Int
9+
try{
10+
mode = Integer.parseInt(args[0])
11+
mutArgs.removeAt(0)
12+
} catch (e: Exception){ mode = 1 }
13+
val apiPath = File(File(
14+
FindLocationOfTheThing::class.java.protectionDomain.codeSource.location.toURI())
15+
.getParent()).toPath().resolve("API").resolve("exampleAPI.jar").toUri().toURL()
16+
val programLocation = File(File(
17+
FindLocationOfTheThing::class.java.protectionDomain.codeSource.location.toURI())
18+
.getParent()).toPath().resolve("MyProgram").resolve("examplepluginloader.jar").toUri().toURL()
19+
val sysloader = URLClassLoader("MySysLoader", arrayOf(apiPath), ClassLoader.getSystemClassLoader())
20+
val programloader = URLClassLoader("MyProgramLoader", arrayOf(programLocation), sysloader)
21+
programloader.loadClass("examplepluginloader.program.MyProgram").getConstructor(List::class.java, Int::class.java).newInstance(mutArgs.toList(), mode)
22+
}
2323
private class FindLocationOfTheThing() {}

entryPoint/build.gradle.kts

+36-36
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
1-
plugins {
2-
kotlin("jvm")
3-
id("com.github.johnrengelman.shadow") version "8.1.1"
4-
// Apply the java-library plugin for API and implementation separation.
5-
`java-library`
6-
}
7-
repositories {
8-
mavenCentral()
9-
gradlePluginPortal()
10-
}
11-
dependencies {
12-
implementation(kotlin("stdlib"))
13-
implementation("org.apache.commons:commons-math3:3.6.1")
14-
implementation(project(":exampleAPI"))
15-
implementation("org.ow2.asm:asm:9.5")
16-
implementation("com.google.guava:guava:31.1-jre")
17-
runtimeOnly("org.slf4j:slf4j-nop:1.7.32")
18-
//implementation("org.jetbrains.kotlin:kotlin-reflect:1.8.10")
19-
//implementation("org.reflections:reflections:0.10.2")
20-
}
21-
// Apply a specific Java toolchain to ease working on different environments.
22-
java {
23-
toolchain {
24-
languageVersion.set(JavaLanguageVersion.of(17))
25-
}
26-
}
27-
tasks {
28-
// java-library plugin wont find main class for us but we want to be able to make kotlin runtime available to plugins so we need it
29-
jar {
30-
manifest { attributes( "Main-Class" to "examplepluginloader.MainKt" ) }
31-
}
32-
// make it output to the shared output directory to make it easier to run it with the plugin (the example program uses the loader to load from ./ by default unless you specify)
33-
shadowJar {
34-
destinationDirectory.set(file("../ExampleOut/"))
35-
archiveFileName.set("entryPoint.jar")
36-
}
1+
plugins {
2+
kotlin("jvm")
3+
id("com.github.johnrengelman.shadow") version "8.1.1"
4+
// Apply the java-library plugin for API and implementation separation.
5+
`java-library`
6+
}
7+
repositories {
8+
mavenCentral()
9+
gradlePluginPortal()
10+
}
11+
dependencies {
12+
implementation(kotlin("stdlib"))
13+
implementation("org.apache.commons:commons-math3:3.6.1")
14+
implementation(project(":exampleAPI"))
15+
implementation("org.ow2.asm:asm:9.5")
16+
implementation("com.google.guava:guava:31.1-jre")
17+
runtimeOnly("org.slf4j:slf4j-nop:1.7.32")
18+
//implementation("org.jetbrains.kotlin:kotlin-reflect:1.8.10")
19+
//implementation("org.reflections:reflections:0.10.2")
20+
}
21+
// Apply a specific Java toolchain to ease working on different environments.
22+
java {
23+
toolchain {
24+
languageVersion.set(JavaLanguageVersion.of(17))
25+
}
26+
}
27+
tasks {
28+
// java-library plugin wont find main class for us but we want to be able to make kotlin runtime available to plugins so we need it
29+
jar {
30+
manifest { attributes( "Main-Class" to "examplepluginloader.MainKt" ) }
31+
}
32+
// make it output to the shared output directory to make it easier to run it with the plugin (the example program uses the loader to load from ./ by default unless you specify)
33+
shadowJar {
34+
destinationDirectory.set(file("../ExampleOut/"))
35+
archiveFileName.set("entryPoint.jar")
36+
}
3737
}
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
package examplepluginloader
2-
import kotlin.collections.remove
3-
import java.io.File
4-
import java.lang.reflect.Type
5-
import java.net.URLClassLoader
6-
fun main(args: Array<String>) {
7-
val mutArgs = args.toMutableList()
8-
var mode :Int
9-
try{
10-
mode = Integer.parseInt(args[0])
11-
mutArgs.removeAt(0)
12-
} catch (e: Exception){ mode = 1 }
13-
val apiPath = File(File(
14-
FindLocationOfTheThing::class.java.protectionDomain.codeSource.location.toURI())
15-
.getParent()).toPath().resolve("API").resolve("exampleAPI.jar").toUri().toURL()
16-
val programLocation = File(File(
17-
FindLocationOfTheThing::class.java.protectionDomain.codeSource.location.toURI())
18-
.getParent()).toPath().resolve("MyProgram").resolve("examplepluginloader.jar").toUri().toURL()
19-
val sysloader = URLClassLoader("MySysLoader", arrayOf(apiPath), ClassLoader.getSystemClassLoader())
20-
val programloader = URLClassLoader("MyProgramLoader", arrayOf(programLocation), sysloader)
21-
programloader.loadClass("examplepluginloader.program.MyProgram").getConstructor(List::class.java, Int::class.java).newInstance(mutArgs.toList(), mode)
22-
}
1+
package examplepluginloader
2+
import kotlin.collections.remove
3+
import java.io.File
4+
import java.lang.reflect.Type
5+
import java.net.URLClassLoader
6+
fun main(args: Array<String>) {
7+
val mutArgs = args.toMutableList()
8+
var mode :Int
9+
try{
10+
mode = Integer.parseInt(args[0])
11+
mutArgs.removeAt(0)
12+
} catch (e: Exception){ mode = 1 }
13+
val apiPath = File(File(
14+
FindLocationOfTheThing::class.java.protectionDomain.codeSource.location.toURI())
15+
.getParent()).toPath().resolve("API").resolve("exampleAPI.jar").toUri().toURL()
16+
val programLocation = File(File(
17+
FindLocationOfTheThing::class.java.protectionDomain.codeSource.location.toURI())
18+
.getParent()).toPath().resolve("MyProgram").resolve("examplepluginloader.jar").toUri().toURL()
19+
val sysloader = URLClassLoader("MySysLoader", arrayOf(apiPath), ClassLoader.getSystemClassLoader())
20+
val programloader = URLClassLoader("MyProgramLoader", arrayOf(programLocation), sysloader)
21+
programloader.loadClass("examplepluginloader.program.MyProgram").getConstructor(List::class.java, Int::class.java).newInstance(mutArgs.toList(), mode)
22+
}
2323
private class FindLocationOfTheThing() {}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
package examplepluginloader.api
2-
import examplepluginloader.api.plugin.ManagePlugins
3-
public interface MyAPI {
4-
//this would normally have a lot more things in it.
5-
fun plugin(): ManagePlugins
1+
package examplepluginloader.api
2+
import examplepluginloader.api.plugin.ManagePlugins
3+
public interface MyAPI {
4+
//this would normally have a lot more things in it.
5+
fun plugin(): ManagePlugins
66
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
package examplepluginloader.api
2-
import examplepluginloader.api.MyAPI
3-
public interface MyPlugin {
4-
fun launchPlugin(api: MyAPI)
1+
package examplepluginloader.api
2+
import examplepluginloader.api.MyAPI
3+
public interface MyPlugin {
4+
fun launchPlugin(api: MyAPI)
55
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
package examplepluginloader.api.plugin
2-
import java.net.URL
3-
public interface ManagePlugins{
4-
fun pluginLocation(): URL?
5-
fun unloadPlugin()
6-
fun registerShutdownSequence(unldHndlr: PluginUnloadHandler): Plugistration
1+
package examplepluginloader.api.plugin
2+
import java.net.URL
3+
public interface ManagePlugins{
4+
fun pluginLocation(): URL?
5+
fun unloadPlugin()
6+
fun registerShutdownSequence(unldHndlr: PluginUnloadHandler): Plugistration
77
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
package examplepluginloader.api.plugin
2-
3-
public interface PluginUnloadHandler {
4-
fun pluginUnloaded()
1+
package examplepluginloader.api.plugin
2+
3+
public interface PluginUnloadHandler {
4+
fun pluginUnloaded()
55
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
package examplepluginloader.api.plugin
2-
public interface Plugistration {
3-
fun isRegistered(): Boolean
4-
fun deregister()
1+
package examplepluginloader.api.plugin
2+
public interface Plugistration {
3+
fun isRegistered(): Boolean
4+
fun deregister()
55
}

exampleAPI/build.gradle.kts

+27-27
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
plugins {
2-
kotlin("jvm")
3-
//id("com.github.johnrengelman.shadow") version "8.1.1"
4-
// Apply the java-library plugin for API and implementation separation.
5-
`java-library`
6-
}
7-
repositories {
8-
mavenCentral()
9-
gradlePluginPortal()
10-
}
11-
dependencies {
12-
compileOnly(kotlin("stdlib"))
13-
compileOnly("org.apache.commons:commons-math3:3.6.1")
14-
compileOnly("com.google.guava:guava:31.1-jre")
15-
}
16-
// Apply a specific Java toolchain to ease working on different environments.
17-
java {
18-
toolchain {
19-
languageVersion.set(JavaLanguageVersion.of(17))
20-
}
21-
}
22-
tasks {
23-
// make it output to the shared output directory to make it easier to run it with the plugin
24-
jar {
25-
destinationDirectory.set(file("../ExampleOut/API/"))
26-
archiveFileName.set("exampleAPI.jar")
27-
}
1+
plugins {
2+
kotlin("jvm")
3+
//id("com.github.johnrengelman.shadow") version "8.1.1"
4+
// Apply the java-library plugin for API and implementation separation.
5+
`java-library`
6+
}
7+
repositories {
8+
mavenCentral()
9+
gradlePluginPortal()
10+
}
11+
dependencies {
12+
compileOnly(kotlin("stdlib"))
13+
compileOnly("org.apache.commons:commons-math3:3.6.1")
14+
compileOnly("com.google.guava:guava:31.1-jre")
15+
}
16+
// Apply a specific Java toolchain to ease working on different environments.
17+
java {
18+
toolchain {
19+
languageVersion.set(JavaLanguageVersion.of(17))
20+
}
21+
}
22+
tasks {
23+
// make it output to the shared output directory to make it easier to run it with the plugin
24+
jar {
25+
destinationDirectory.set(file("../ExampleOut/API/"))
26+
archiveFileName.set("exampleAPI.jar")
27+
}
2828
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
package examplepluginloader.api
2-
import examplepluginloader.api.plugin.ManagePlugins
3-
public interface MyAPI {
4-
//this would normally have a lot more things in it.
5-
fun plugin(): ManagePlugins
1+
package examplepluginloader.api
2+
import examplepluginloader.api.plugin.ManagePlugins
3+
public interface MyAPI {
4+
//this would normally have a lot more things in it.
5+
fun plugin(): ManagePlugins
66
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
package examplepluginloader.api
2-
import examplepluginloader.api.MyAPI
3-
public interface MyPlugin {
4-
fun launchPlugin(api: MyAPI)
1+
package examplepluginloader.api
2+
import examplepluginloader.api.MyAPI
3+
public interface MyPlugin {
4+
fun launchPlugin(api: MyAPI)
55
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
package examplepluginloader.api.plugin
2-
import java.net.URL
3-
public interface ManagePlugins{
4-
fun pluginLocation(): URL?
5-
fun unloadPlugin()
6-
fun registerShutdownSequence(unldHndlr: PluginUnloadHandler): Plugistration
1+
package examplepluginloader.api.plugin
2+
import java.net.URL
3+
public interface ManagePlugins{
4+
fun pluginLocation(): URL?
5+
fun unloadPlugin()
6+
fun registerShutdownSequence(unldHndlr: PluginUnloadHandler): Plugistration
77
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
package examplepluginloader.api.plugin
2-
3-
public interface PluginUnloadHandler {
4-
fun pluginUnloaded()
1+
package examplepluginloader.api.plugin
2+
3+
public interface PluginUnloadHandler {
4+
fun pluginUnloaded()
55
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
package examplepluginloader.api.plugin
2-
public interface Plugistration {
3-
fun isRegistered(): Boolean
4-
fun deregister()
1+
package examplepluginloader.api.plugin
2+
public interface Plugistration {
3+
fun isRegistered(): Boolean
4+
fun deregister()
55
}

0 commit comments

Comments
 (0)