diff --git a/build.gradle b/build.gradle index eace1084..c97da999 100644 --- a/build.gradle +++ b/build.gradle @@ -14,30 +14,4 @@ buildscript { } } -apply plugin: "kotlin" -apply plugin: "application" -apply plugin: "com.github.ben-manes.versions" - -mainClassName = "org.ethereum.lists.chains.MainKt" - -repositories { - mavenCentral() - maven { url 'https://jitpack.io' } -} - -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib:${KOTLIN_VERSION}" - - implementation "com.github.komputing.kethereum:rpc:${KETHEREUM_VERSION}" - implementation "com.github.komputing.kethereum:model:${KETHEREUM_VERSION}" - implementation "com.github.komputing.kethereum:erc55:${KETHEREUM_VERSION}" - implementation "com.github.komputing.kethereum:crypto_impl_bouncycastle:${KETHEREUM_VERSION}" - - implementation 'com.beust:klaxon:5.5' - implementation 'com.squareup.moshi:moshi-kotlin:1.13.0' - implementation 'com.squareup.okhttp3:okhttp:4.9.3' - - testImplementation "org.jetbrains.kotlin:kotlin-test:${KOTLIN_VERSION}" - testImplementation "org.jetbrains.kotlin:kotlin-test-junit:${KOTLIN_VERSION}" -} - +apply plugin: "com.github.ben-manes.versions" \ No newline at end of file diff --git a/model/build.gradle b/model/build.gradle new file mode 100644 index 00000000..87f496b4 --- /dev/null +++ b/model/build.gradle @@ -0,0 +1,15 @@ +apply plugin: "kotlin" + +repositories { + mavenCentral() + maven { url 'https://jitpack.io' } +} + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib:${KOTLIN_VERSION}" + + implementation 'com.squareup.moshi:moshi-kotlin:1.13.0' + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + +} + diff --git a/src/main/kotlin/org/ethereum/lists/chains/model/Chain.kt b/model/src/main/kotlin/org/ethereum/lists/chains/model/Chain.kt similarity index 100% rename from src/main/kotlin/org/ethereum/lists/chains/model/Chain.kt rename to model/src/main/kotlin/org/ethereum/lists/chains/model/Chain.kt diff --git a/src/main/kotlin/org/ethereum/lists/chains/model/Explorer.kt b/model/src/main/kotlin/org/ethereum/lists/chains/model/Explorer.kt similarity index 100% rename from src/main/kotlin/org/ethereum/lists/chains/model/Explorer.kt rename to model/src/main/kotlin/org/ethereum/lists/chains/model/Explorer.kt diff --git a/processor/build.gradle b/processor/build.gradle new file mode 100644 index 00000000..1b4b6eb9 --- /dev/null +++ b/processor/build.gradle @@ -0,0 +1,28 @@ +apply plugin: "kotlin" +apply plugin: "application" + +mainClassName = "org.ethereum.lists.chains.MainKt" + +repositories { + mavenCentral() + maven { url 'https://jitpack.io' } +} + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib:${KOTLIN_VERSION}" + + implementation "com.github.komputing.kethereum:rpc:${KETHEREUM_VERSION}" + implementation "com.github.komputing.kethereum:model:${KETHEREUM_VERSION}" + implementation "com.github.komputing.kethereum:erc55:${KETHEREUM_VERSION}" + implementation "com.github.komputing.kethereum:crypto_impl_bouncycastle:${KETHEREUM_VERSION}" + + implementation 'com.beust:klaxon:5.5' + implementation 'com.squareup.moshi:moshi-kotlin:1.13.0' + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + implementation project(":model") + + testImplementation "org.jetbrains.kotlin:kotlin-test:${KOTLIN_VERSION}" + testImplementation "org.jetbrains.kotlin:kotlin-test-junit:${KOTLIN_VERSION}" +} + diff --git a/src/main/kotlin/org/ethereum/lists/chains/Env.kt b/processor/src/main/kotlin/org/ethereum/lists/chains/Env.kt similarity index 100% rename from src/main/kotlin/org/ethereum/lists/chains/Env.kt rename to processor/src/main/kotlin/org/ethereum/lists/chains/Env.kt diff --git a/src/main/kotlin/org/ethereum/lists/chains/Main.kt b/processor/src/main/kotlin/org/ethereum/lists/chains/Main.kt similarity index 97% rename from src/main/kotlin/org/ethereum/lists/chains/Main.kt rename to processor/src/main/kotlin/org/ethereum/lists/chains/Main.kt index ff65b415..904d62f6 100644 --- a/src/main/kotlin/org/ethereum/lists/chains/Main.kt +++ b/processor/src/main/kotlin/org/ethereum/lists/chains/Main.kt @@ -12,9 +12,11 @@ import org.kethereum.rpc.HttpEthereumRPC val parsedShortNames = mutableSetOf() val parsedNames = mutableSetOf() -val iconsPath = File("_data/icons") +val basePath = File("..") +val dataPath = File(basePath, "_data") +val iconsPath = File(dataPath, "icons") -val chainsPath = File("_data/chains") +val chainsPath = File(dataPath, "chains") private val allFiles = chainsPath.listFiles() ?: error("$chainsPath must contain the chain json files - but it does not") private val allChainFiles = allFiles.filter { !it.isDirectory } @@ -26,7 +28,7 @@ fun main(args: Array) { } private fun createOutputFiles() { - val buildPath = File("output").apply { mkdir() } + val buildPath = File(basePath, "output").apply { mkdir() } val chainJSONArray = JsonArray() val miniChainJSONArray = JsonArray() diff --git a/src/main/kotlin/org/ethereum/lists/chains/model/Exceptions.kt b/processor/src/main/kotlin/org/ethereum/lists/chains/model/Exceptions.kt similarity index 100% rename from src/main/kotlin/org/ethereum/lists/chains/model/Exceptions.kt rename to processor/src/main/kotlin/org/ethereum/lists/chains/model/Exceptions.kt diff --git a/src/test/kotlin/org/ethereum/lists/chains/TheChainChecker.kt b/processor/src/test/kotlin/org/ethereum/lists/chains/TheChainChecker.kt similarity index 100% rename from src/test/kotlin/org/ethereum/lists/chains/TheChainChecker.kt rename to processor/src/test/kotlin/org/ethereum/lists/chains/TheChainChecker.kt diff --git a/src/test/resources/test_chains/invalid/eip155-1.json b/processor/src/test/resources/test_chains/invalid/eip155-1.json similarity index 100% rename from src/test/resources/test_chains/invalid/eip155-1.json rename to processor/src/test/resources/test_chains/invalid/eip155-1.json diff --git a/src/test/resources/test_chains/invalid/eip155-1.nojson b/processor/src/test/resources/test_chains/invalid/eip155-1.nojson similarity index 100% rename from src/test/resources/test_chains/invalid/eip155-1.nojson rename to processor/src/test/resources/test_chains/invalid/eip155-1.nojson diff --git a/src/test/resources/test_chains/invalid/eip155-100.json b/processor/src/test/resources/test_chains/invalid/eip155-100.json similarity index 100% rename from src/test/resources/test_chains/invalid/eip155-100.json rename to processor/src/test/resources/test_chains/invalid/eip155-100.json diff --git a/src/test/resources/test_chains/invalid/eip155-101.json b/processor/src/test/resources/test_chains/invalid/eip155-101.json similarity index 100% rename from src/test/resources/test_chains/invalid/eip155-101.json rename to processor/src/test/resources/test_chains/invalid/eip155-101.json diff --git a/src/test/resources/test_chains/invalid/eip155-102.json b/processor/src/test/resources/test_chains/invalid/eip155-102.json similarity index 100% rename from src/test/resources/test_chains/invalid/eip155-102.json rename to processor/src/test/resources/test_chains/invalid/eip155-102.json diff --git a/src/test/resources/test_chains/invalid/eip155-2.json b/processor/src/test/resources/test_chains/invalid/eip155-2.json similarity index 100% rename from src/test/resources/test_chains/invalid/eip155-2.json rename to processor/src/test/resources/test_chains/invalid/eip155-2.json diff --git a/src/test/resources/test_chains/invalid/eip155-3.json b/processor/src/test/resources/test_chains/invalid/eip155-3.json similarity index 100% rename from src/test/resources/test_chains/invalid/eip155-3.json rename to processor/src/test/resources/test_chains/invalid/eip155-3.json diff --git a/src/test/resources/test_chains/invalid/eip155-4.json b/processor/src/test/resources/test_chains/invalid/eip155-4.json similarity index 100% rename from src/test/resources/test_chains/invalid/eip155-4.json rename to processor/src/test/resources/test_chains/invalid/eip155-4.json diff --git a/src/test/resources/test_chains/invalid/eip155-99.json b/processor/src/test/resources/test_chains/invalid/eip155-99.json similarity index 100% rename from src/test/resources/test_chains/invalid/eip155-99.json rename to processor/src/test/resources/test_chains/invalid/eip155-99.json diff --git a/src/test/resources/test_chains/invalid/eip155-invalid_filename.json b/processor/src/test/resources/test_chains/invalid/eip155-invalid_filename.json similarity index 100% rename from src/test/resources/test_chains/invalid/eip155-invalid_filename.json rename to processor/src/test/resources/test_chains/invalid/eip155-invalid_filename.json diff --git a/src/test/resources/test_chains/invalid/explorerinvalidurl/eip155-1.json b/processor/src/test/resources/test_chains/invalid/explorerinvalidurl/eip155-1.json similarity index 100% rename from src/test/resources/test_chains/invalid/explorerinvalidurl/eip155-1.json rename to processor/src/test/resources/test_chains/invalid/explorerinvalidurl/eip155-1.json diff --git a/src/test/resources/test_chains/invalid/explorermissingurl/eip155-1.json b/processor/src/test/resources/test_chains/invalid/explorermissingurl/eip155-1.json similarity index 100% rename from src/test/resources/test_chains/invalid/explorermissingurl/eip155-1.json rename to processor/src/test/resources/test_chains/invalid/explorermissingurl/eip155-1.json diff --git a/src/test/resources/test_chains/invalid/explorernoname/eip155-1.json b/processor/src/test/resources/test_chains/invalid/explorernoname/eip155-1.json similarity index 100% rename from src/test/resources/test_chains/invalid/explorernoname/eip155-1.json rename to processor/src/test/resources/test_chains/invalid/explorernoname/eip155-1.json diff --git a/src/test/resources/test_chains/invalid/explorersnotarray/eip155-1.json b/processor/src/test/resources/test_chains/invalid/explorersnotarray/eip155-1.json similarity index 100% rename from src/test/resources/test_chains/invalid/explorersnotarray/eip155-1.json rename to processor/src/test/resources/test_chains/invalid/explorersnotarray/eip155-1.json diff --git a/src/test/resources/test_chains/invalid/extracomma/eip155-1.json b/processor/src/test/resources/test_chains/invalid/extracomma/eip155-1.json similarity index 100% rename from src/test/resources/test_chains/invalid/extracomma/eip155-1.json rename to processor/src/test/resources/test_chains/invalid/extracomma/eip155-1.json diff --git a/src/test/resources/test_chains/invalid/sameshortname/eip155-1.json b/processor/src/test/resources/test_chains/invalid/sameshortname/eip155-1.json similarity index 100% rename from src/test/resources/test_chains/invalid/sameshortname/eip155-1.json rename to processor/src/test/resources/test_chains/invalid/sameshortname/eip155-1.json diff --git a/src/test/resources/test_chains/invalid/sameshortname/eip155-5.json b/processor/src/test/resources/test_chains/invalid/sameshortname/eip155-5.json similarity index 100% rename from src/test/resources/test_chains/invalid/sameshortname/eip155-5.json rename to processor/src/test/resources/test_chains/invalid/sameshortname/eip155-5.json diff --git a/src/test/resources/test_chains/invalid/withparentchaindoesnotexist/eip155-2.json b/processor/src/test/resources/test_chains/invalid/withparentchaindoesnotexist/eip155-2.json similarity index 100% rename from src/test/resources/test_chains/invalid/withparentchaindoesnotexist/eip155-2.json rename to processor/src/test/resources/test_chains/invalid/withparentchaindoesnotexist/eip155-2.json diff --git a/src/test/resources/test_chains/invalid/withparentextrabridgeelementnoobject/eip155-2.json b/processor/src/test/resources/test_chains/invalid/withparentextrabridgeelementnoobject/eip155-2.json similarity index 100% rename from src/test/resources/test_chains/invalid/withparentextrabridgeelementnoobject/eip155-2.json rename to processor/src/test/resources/test_chains/invalid/withparentextrabridgeelementnoobject/eip155-2.json diff --git a/src/test/resources/test_chains/invalid/withparentextrabridgesfield/eip155-2.json b/processor/src/test/resources/test_chains/invalid/withparentextrabridgesfield/eip155-2.json similarity index 100% rename from src/test/resources/test_chains/invalid/withparentextrabridgesfield/eip155-2.json rename to processor/src/test/resources/test_chains/invalid/withparentextrabridgesfield/eip155-2.json diff --git a/src/test/resources/test_chains/invalid/withparentextrabridgesnoarray/eip155-2.json b/processor/src/test/resources/test_chains/invalid/withparentextrabridgesnoarray/eip155-2.json similarity index 100% rename from src/test/resources/test_chains/invalid/withparentextrabridgesnoarray/eip155-2.json rename to processor/src/test/resources/test_chains/invalid/withparentextrabridgesnoarray/eip155-2.json diff --git a/src/test/resources/test_chains/invalid/withparentextrafield/eip155-2.json b/processor/src/test/resources/test_chains/invalid/withparentextrafield/eip155-2.json similarity index 100% rename from src/test/resources/test_chains/invalid/withparentextrafield/eip155-2.json rename to processor/src/test/resources/test_chains/invalid/withparentextrafield/eip155-2.json diff --git a/src/test/resources/test_chains/invalid/withparentinvalidtype/eip155-2.json b/processor/src/test/resources/test_chains/invalid/withparentinvalidtype/eip155-2.json similarity index 100% rename from src/test/resources/test_chains/invalid/withparentinvalidtype/eip155-2.json rename to processor/src/test/resources/test_chains/invalid/withparentinvalidtype/eip155-2.json diff --git a/src/test/resources/test_chains/invalid/withparentnobject/eip155-2.json b/processor/src/test/resources/test_chains/invalid/withparentnobject/eip155-2.json similarity index 100% rename from src/test/resources/test_chains/invalid/withparentnobject/eip155-2.json rename to processor/src/test/resources/test_chains/invalid/withparentnobject/eip155-2.json diff --git a/src/test/resources/test_chains/invalid/wrongexplorerstandard/eip155-1.json b/processor/src/test/resources/test_chains/invalid/wrongexplorerstandard/eip155-1.json similarity index 100% rename from src/test/resources/test_chains/invalid/wrongexplorerstandard/eip155-1.json rename to processor/src/test/resources/test_chains/invalid/wrongexplorerstandard/eip155-1.json diff --git a/src/test/resources/test_chains/valid/eip155-1.json b/processor/src/test/resources/test_chains/valid/eip155-1.json similarity index 100% rename from src/test/resources/test_chains/valid/eip155-1.json rename to processor/src/test/resources/test_chains/valid/eip155-1.json diff --git a/src/test/resources/test_chains/valid/eip155-5.json b/processor/src/test/resources/test_chains/valid/eip155-5.json similarity index 100% rename from src/test/resources/test_chains/valid/eip155-5.json rename to processor/src/test/resources/test_chains/valid/eip155-5.json diff --git a/src/test/resources/test_chains/valid/withexplorer/eip155-1.json b/processor/src/test/resources/test_chains/valid/withexplorer/eip155-1.json similarity index 100% rename from src/test/resources/test_chains/valid/withexplorer/eip155-1.json rename to processor/src/test/resources/test_chains/valid/withexplorer/eip155-1.json diff --git a/src/test/resources/test_chains/valid/withexplorer/eip155-2.json b/processor/src/test/resources/test_chains/valid/withexplorer/eip155-2.json similarity index 100% rename from src/test/resources/test_chains/valid/withexplorer/eip155-2.json rename to processor/src/test/resources/test_chains/valid/withexplorer/eip155-2.json diff --git a/src/test/resources/test_chains/valid/withparent/eip155-1.json b/processor/src/test/resources/test_chains/valid/withparent/eip155-1.json similarity index 100% rename from src/test/resources/test_chains/valid/withparent/eip155-1.json rename to processor/src/test/resources/test_chains/valid/withparent/eip155-1.json diff --git a/src/test/resources/test_chains/valid/withparent/eip155-2.json b/processor/src/test/resources/test_chains/valid/withparent/eip155-2.json similarity index 100% rename from src/test/resources/test_chains/valid/withparent/eip155-2.json rename to processor/src/test/resources/test_chains/valid/withparent/eip155-2.json diff --git a/src/test/resources/test_chains/valid/withparentbridge/eip155-1.json b/processor/src/test/resources/test_chains/valid/withparentbridge/eip155-1.json similarity index 100% rename from src/test/resources/test_chains/valid/withparentbridge/eip155-1.json rename to processor/src/test/resources/test_chains/valid/withparentbridge/eip155-1.json diff --git a/src/test/resources/test_chains/valid/withparentbridge/eip155-2.json b/processor/src/test/resources/test_chains/valid/withparentbridge/eip155-2.json similarity index 100% rename from src/test/resources/test_chains/valid/withparentbridge/eip155-2.json rename to processor/src/test/resources/test_chains/valid/withparentbridge/eip155-2.json diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 00000000..7befe42f --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,2 @@ +include(":model") +include(":processor") \ No newline at end of file