mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-12-19 15:09:18 +00:00
minor code cleanup
This commit is contained in:
@@ -284,6 +284,7 @@ public class IrisData implements ExclusionStrategy, TypeAdapterFactory {
|
|||||||
public void close() {
|
public void close() {
|
||||||
closed = true;
|
closed = true;
|
||||||
dump();
|
dump();
|
||||||
|
dataLoaders.remove(dataFolder);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IrisData copy() {
|
public IrisData copy() {
|
||||||
|
|||||||
@@ -355,7 +355,7 @@ public class IrisProject {
|
|||||||
settings.put("json.schemas", schemas);
|
settings.put("json.schemas", schemas);
|
||||||
ws.put("settings", settings);
|
ws.put("settings", settings);
|
||||||
|
|
||||||
SimpleEnvironment.create().configureProject(path);
|
dm.getEnvironment().configureProject();
|
||||||
File schemasFile = new File(path, ".idea" + File.separator + "jsonSchemas.xml");
|
File schemasFile = new File(path, ".idea" + File.separator + "jsonSchemas.xml");
|
||||||
Document doc = IO.read(schemasFile);
|
Document doc = IO.read(schemasFile);
|
||||||
Element mappings = (Element) doc.selectSingleNode("//component[@name='JsonSchemaMappingsProjectConfiguration']");
|
Element mappings = (Element) doc.selectSingleNode("//component[@name='JsonSchemaMappingsProjectConfiguration']");
|
||||||
|
|||||||
@@ -12,7 +12,11 @@ public interface SimpleEnvironment {
|
|||||||
return new IrisSimpleExecutionEnvironment();
|
return new IrisSimpleExecutionEnvironment();
|
||||||
}
|
}
|
||||||
|
|
||||||
void configureProject(@NonNull File projectDir);
|
static SimpleEnvironment create(@NonNull File projectDir) {
|
||||||
|
return new IrisSimpleExecutionEnvironment(projectDir);
|
||||||
|
}
|
||||||
|
|
||||||
|
void configureProject();
|
||||||
|
|
||||||
void execute(@NonNull String script);
|
void execute(@NonNull String script);
|
||||||
|
|
||||||
|
|||||||
@@ -77,14 +77,14 @@ open class IrisSimpleExecutionEnvironment(
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun configureProject(projectDir: File) {
|
override fun configureProject() {
|
||||||
projectDir.mkdirs()
|
runner.baseDir.mkdirs()
|
||||||
val libs = listOf(javaClass.classLoader.classpath, KotlinScript::class.java.classLoader.classpath)
|
val libs = listOf(javaClass.classLoader.classpath, KotlinScript::class.java.classLoader.classpath)
|
||||||
.flatMap { it }
|
.flatMap { it }
|
||||||
.sortedBy { it.absolutePath }
|
.sortedBy { it.absolutePath }
|
||||||
.toMutableList()
|
.toMutableList()
|
||||||
|
|
||||||
File(projectDir, "build.gradle.kts")
|
File(runner.baseDir, "build.gradle.kts")
|
||||||
.updateClasspath(libs)
|
.updateClasspath(libs)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import kotlin.script.experimental.jvmhost.BasicJvmScriptingHost
|
|||||||
|
|
||||||
class ScriptRunner(
|
class ScriptRunner(
|
||||||
private val host: BasicJvmScriptingHost,
|
private val host: BasicJvmScriptingHost,
|
||||||
private val baseDir: File
|
val baseDir: File
|
||||||
) {
|
) {
|
||||||
constructor(baseDir: File) : this(BasicJvmScriptingHost(), baseDir)
|
constructor(baseDir: File) : this(BasicJvmScriptingHost(), baseDir)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user