mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
standardize BuildScript directives
moved buildScript directive to Directives.kt tagged BuildScriptConfig methods with @Directive
This commit is contained in:
parent
c74c2ad716
commit
a5f3b6b8e7
2 changed files with 9 additions and 5 deletions
|
@ -16,12 +16,15 @@ var BUILD_SCRIPT_CONFIG : BuildScriptConfig? = null
|
|||
|
||||
class BuildScriptConfig {
|
||||
/** The list of repos used to locate plug-ins. */
|
||||
@Directive
|
||||
fun repos(vararg r: String) = newRepos(*r)
|
||||
|
||||
/** The list of plug-ins to use for this build file. */
|
||||
@Directive
|
||||
fun plugins(vararg pl: String) = newPlugins(*pl)
|
||||
|
||||
/** The build file classpath. */
|
||||
@Directive
|
||||
fun buildFileClasspath(vararg bfc: String) = newBuildFileClasspath(*bfc)
|
||||
|
||||
// The following settings modify the compiler used to compile the build file.
|
||||
|
@ -31,11 +34,6 @@ class BuildScriptConfig {
|
|||
var kobaltCompilerFlags: String? = null
|
||||
}
|
||||
|
||||
@Directive
|
||||
fun buildScript(init: BuildScriptConfig.() -> Unit) {
|
||||
BUILD_SCRIPT_CONFIG = BuildScriptConfig().apply { init() }
|
||||
}
|
||||
|
||||
@Directive
|
||||
fun homeDir(vararg dirs: String) : String = SystemProperties.homeDir +
|
||||
File.separator + dirs.toMutableList().joinToString(File.separator)
|
||||
|
|
|
@ -14,3 +14,9 @@ fun project(vararg projects: Project, init: Project.() -> Unit): Project {
|
|||
}
|
||||
}
|
||||
|
||||
@Directive
|
||||
fun buildScript(init: BuildScriptConfig.() -> Unit): BuildScriptConfig {
|
||||
val buildScriptConfig = BuildScriptConfig().apply { init() }
|
||||
BUILD_SCRIPT_CONFIG = buildScriptConfig
|
||||
return buildScriptConfig
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue