-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restructure ModuleBuilder dependencies, move into new module
- Loading branch information
1 parent
23a7cba
commit b732d2e
Showing
25 changed files
with
247 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
plugins { | ||
id("internal-lib") | ||
} | ||
|
||
kotlin { | ||
sourceSets { | ||
commonMain { | ||
dependencies { | ||
implementation(project(":ktpack-internal:platform")) | ||
implementation(project(":ktpack-internal:models")) | ||
} | ||
} | ||
|
||
commonTest { | ||
dependencies { | ||
implementation(project(":ktpack-internal:test-utils")) | ||
implementation(libs.coroutines.test) | ||
} | ||
} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...k-internal/manifest-loader/src/commonMain/kotlin/ktpack/manifest/DefaultManifestLoader.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package ktpack.manifest | ||
|
||
import kotlinx.io.files.Path | ||
import kotlinx.serialization.decodeFromString | ||
import ktpack.util.exists | ||
import ktpack.util.readString | ||
import ktpack.util.resolve | ||
import ktpack.util.workingDirectory | ||
|
||
class DefaultManifestLoader : ManifestLoader { | ||
|
||
override fun load(filePath: String): ManifestToml { | ||
val path = Path(filePath).let { path -> | ||
if (path.isAbsolute) { | ||
path | ||
} else { | ||
Path(workingDirectory, path.toString()).resolve() | ||
} | ||
} | ||
check(path.exists()) { "No $MANIFEST_FILENAME file found in '${path.parent}'" } | ||
return toml.decodeFromString<ManifestToml>(path.readString()) | ||
.resolveDependencyShorthand() | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
ktpack-internal/manifest-loader/src/commonMain/kotlin/ktpack/manifest/ManifestLoader.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package ktpack.manifest | ||
|
||
const val MANIFEST_FILENAME = "pack.toml" | ||
|
||
interface ManifestLoader { | ||
|
||
fun load( | ||
filePath: String = MANIFEST_FILENAME | ||
): ManifestToml | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
plugins { | ||
id("internal-lib") | ||
} | ||
|
||
kotlin { | ||
sourceSets { | ||
commonMain { | ||
dependencies { | ||
implementation(project(":ktpack-internal:platform")) | ||
implementation(project(":ktpack-internal:models")) | ||
implementation(project(":ktpack-internal:manifest-loader")) | ||
implementation(project(":ktpack-internal:dependency-resolver")) | ||
implementation(project(":ktpack-internal:toolchains")) | ||
implementation(libs.ksubprocess) | ||
implementation(libs.semver) | ||
} | ||
} | ||
|
||
commonTest { | ||
dependencies { | ||
implementation(project(":ktpack-internal:test-utils")) | ||
implementation(libs.coroutines.test) | ||
} | ||
} | ||
} | ||
} |
File renamed without changes.
14 changes: 14 additions & 0 deletions
14
ktpack-internal/module-builder/src/commonMain/kotlin/ktpack/compilation/BuildContext.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package ktpack.compilation | ||
|
||
import ktpack.compilation.dependencies.MavenDependencyResolver | ||
import ktpack.manifest.ManifestLoader | ||
import ktpack.toolchain.jdk.JdkInstalls | ||
import ktpack.toolchain.kotlin.KotlincInstalls | ||
|
||
class BuildContext( | ||
manifestLoader: ManifestLoader, | ||
val resolver: MavenDependencyResolver, | ||
val jdk: JdkInstalls, | ||
val kotlinc: KotlincInstalls, | ||
val debug: Boolean | ||
) : ManifestLoader by manifestLoader |
Oops, something went wrong.