mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-25 16:07:12 -07:00
Comments.
This commit is contained in:
parent
f21efb6510
commit
f4f5e8c05e
3 changed files with 20 additions and 15 deletions
2
TODO.md
2
TODO.md
|
@ -15,7 +15,7 @@ General
|
|||
- [ ] Fetch .pom with DynamicGraph
|
||||
- [ ] Centralize all the executors
|
||||
- [ ] Archetypes (e.g. "--initWith kobalt-plug-in")
|
||||
- [ ] Compile TestNG (including generating Version.java and OSGi headers)
|
||||
- [ ] Compile TestNG (last piece missing: OSGi headers)
|
||||
- [ ] Support additional .kt files in ~/.kobalt/src
|
||||
- [ ] --init: import dependencies from build.gradle
|
||||
- [ ] --init: also extract kobalt.bat (or generate it along with kobaltw)
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.beust.kobalt.api.annotation.Directive
|
|||
import com.beust.kobalt.internal.IProjectInfo
|
||||
import com.beust.kobalt.maven.dependency.MavenDependency
|
||||
import com.beust.kobalt.misc.KFiles
|
||||
import java.io.File
|
||||
import java.util.*
|
||||
|
||||
open class Project(
|
||||
|
@ -133,25 +134,29 @@ class Dependencies(val project: Project, val dependencies: ArrayList<IClasspathD
|
|||
val providedDependencies: ArrayList<IClasspathDependency>,
|
||||
val runtimeDependencies: ArrayList<IClasspathDependency>,
|
||||
val excludedDependencies: ArrayList<IClasspathDependency>) {
|
||||
@Directive
|
||||
fun compile(vararg dep: String) {
|
||||
dep.forEach { dependencies.add(MavenDependency.create(it)) }
|
||||
|
||||
/**
|
||||
* Add the dependencies to the given ArrayList and return a list of jar files corresponding to
|
||||
* these dependencies.
|
||||
*/
|
||||
private fun addToDependencies(dependencies: ArrayList<IClasspathDependency>, dep: Array<out String>)
|
||||
: List<File>
|
||||
= with(dep.map { MavenDependency.create(it)}) {
|
||||
dependencies.addAll(this)
|
||||
this.map { it.jarFile.get() }
|
||||
}
|
||||
|
||||
@Directive
|
||||
fun provided(vararg dep: String) {
|
||||
dep.forEach { providedDependencies.add(MavenDependency.create(it))}
|
||||
}
|
||||
fun compile(vararg dep: String) = addToDependencies(dependencies, dep)
|
||||
|
||||
@Directive
|
||||
fun runtime(vararg dep: String) {
|
||||
dep.forEach { runtimeDependencies.add(MavenDependency.create(it))}
|
||||
}
|
||||
fun provided(vararg dep: String) = addToDependencies(providedDependencies, dep)
|
||||
|
||||
@Directive
|
||||
fun exclude(vararg dep: String) {
|
||||
dep.forEach { excludedDependencies.add(MavenDependency.create(it))}
|
||||
}
|
||||
fun runtime(vararg dep: String) = addToDependencies(runtimeDependencies, dep)
|
||||
|
||||
@Directive
|
||||
fun exclude(vararg dep: String) = addToDependencies(excludedDependencies, dep)
|
||||
}
|
||||
|
||||
class Scm(val connection: String, val developerConnection: String, val url: String)
|
||||
|
|
|
@ -30,8 +30,8 @@ public class UpdateKobalt @Inject constructor(val github: GithubApi, val wrapper
|
|||
}
|
||||
|
||||
/**
|
||||
* Accepts Future<String> as `latestVersionFuture` to allow getting `latestVersion` in the background
|
||||
* */
|
||||
* Accepts Future<String> as `latestVersionFuture` to allow getting `latestVersion` in the background.
|
||||
*/
|
||||
fun checkForNewVersion(latestVersionFuture: Future<String>) {
|
||||
if (Kobalt.versionCheckTimeout > Duration.between(VersionCheckTimestampFile.timestamp, Instant.now())) {
|
||||
return // waits `Kobalt.versionCheckTimeout` before the next check
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue