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() {
|
||||
closed = true;
|
||||
dump();
|
||||
dataLoaders.remove(dataFolder);
|
||||
}
|
||||
|
||||
public IrisData copy() {
|
||||
|
||||
@@ -355,7 +355,7 @@ public class IrisProject {
|
||||
settings.put("json.schemas", schemas);
|
||||
ws.put("settings", settings);
|
||||
|
||||
SimpleEnvironment.create().configureProject(path);
|
||||
dm.getEnvironment().configureProject();
|
||||
File schemasFile = new File(path, ".idea" + File.separator + "jsonSchemas.xml");
|
||||
Document doc = IO.read(schemasFile);
|
||||
Element mappings = (Element) doc.selectSingleNode("//component[@name='JsonSchemaMappingsProjectConfiguration']");
|
||||
|
||||
@@ -12,7 +12,11 @@ public interface SimpleEnvironment {
|
||||
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);
|
||||
|
||||
|
||||
@@ -77,14 +77,14 @@ open class IrisSimpleExecutionEnvironment(
|
||||
return null
|
||||
}
|
||||
|
||||
override fun configureProject(projectDir: File) {
|
||||
projectDir.mkdirs()
|
||||
override fun configureProject() {
|
||||
runner.baseDir.mkdirs()
|
||||
val libs = listOf(javaClass.classLoader.classpath, KotlinScript::class.java.classLoader.classpath)
|
||||
.flatMap { it }
|
||||
.sortedBy { it.absolutePath }
|
||||
.toMutableList()
|
||||
|
||||
File(projectDir, "build.gradle.kts")
|
||||
File(runner.baseDir, "build.gradle.kts")
|
||||
.updateClasspath(libs)
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import kotlin.script.experimental.jvmhost.BasicJvmScriptingHost
|
||||
|
||||
class ScriptRunner(
|
||||
private val host: BasicJvmScriptingHost,
|
||||
private val baseDir: File
|
||||
val baseDir: File
|
||||
) {
|
||||
constructor(baseDir: File) : this(BasicJvmScriptingHost(), baseDir)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user