mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 16:28:12 -07:00
Make relative paths work.
This commit is contained in:
parent
06e790d462
commit
ee3a1839f7
3 changed files with 4 additions and 18 deletions
|
@ -1,6 +1,7 @@
|
||||||
import com.beust.kobalt.*
|
|
||||||
import com.beust.kobalt.api.License
|
import com.beust.kobalt.api.License
|
||||||
import com.beust.kobalt.api.Scm
|
import com.beust.kobalt.api.Scm
|
||||||
|
import com.beust.kobalt.homeDir
|
||||||
import com.beust.kobalt.internal.test
|
import com.beust.kobalt.internal.test
|
||||||
import com.beust.kobalt.plugin.java.javaCompiler
|
import com.beust.kobalt.plugin.java.javaCompiler
|
||||||
import com.beust.kobalt.plugin.java.javaProject
|
import com.beust.kobalt.plugin.java.javaProject
|
||||||
|
@ -33,7 +34,7 @@ fun readVersion() : String {
|
||||||
val wrapper = javaProject {
|
val wrapper = javaProject {
|
||||||
name = "kobalt-wrapper"
|
name = "kobalt-wrapper"
|
||||||
version = readVersion()
|
version = readVersion()
|
||||||
directory = homeDir("kotlin/kobalt/modules/wrapper")
|
directory = "modules/wrapper"
|
||||||
|
|
||||||
javaCompiler {
|
javaCompiler {
|
||||||
args("-source", "1.7", "-target", "1.7")
|
args("-source", "1.7", "-target", "1.7")
|
||||||
|
|
|
@ -44,21 +44,6 @@ public class BuildFileCompiler @Inject constructor(@Assisted("buildFiles") val b
|
||||||
|
|
||||||
val allProjects = findProjects()
|
val allProjects = findProjects()
|
||||||
|
|
||||||
//
|
|
||||||
// Force each project.directory to be an absolute path, if it's not already
|
|
||||||
//
|
|
||||||
allProjects.forEach {
|
|
||||||
val fd = File(it.directory)
|
|
||||||
if (! fd.isAbsolute) {
|
|
||||||
it.directory =
|
|
||||||
if (args.buildFile != null) {
|
|
||||||
KFiles.findDotDir(File(args.buildFile)).parentFile.absolutePath
|
|
||||||
} else {
|
|
||||||
fd.absolutePath
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
plugins.applyPlugins(context, allProjects)
|
plugins.applyPlugins(context, allProjects)
|
||||||
return allProjects
|
return allProjects
|
||||||
}
|
}
|
||||||
|
|
|
@ -132,7 +132,7 @@ class PackagingPlugin @Inject constructor(val dependencyManager : DependencyMana
|
||||||
// If no includes were specified, assume the user wants a simple jar file made of the
|
// If no includes were specified, assume the user wants a simple jar file made of the
|
||||||
// classes of the project, so we specify a From("build/classes/"), To("") and
|
// classes of the project, so we specify a From("build/classes/"), To("") and
|
||||||
// a list of files containing everything under it
|
// a list of files containing everything under it
|
||||||
val relClassesDir = Paths.get(project.directory).relativize(Paths.get(classesDir.absolutePath + "/"))
|
val relClassesDir = Paths.get(project.directory).relativize(Paths.get(classesDir.path))
|
||||||
val prefixPath = Paths.get(project.directory).relativize(Paths.get(classesDir.path + "/"))
|
val prefixPath = Paths.get(project.directory).relativize(Paths.get(classesDir.path + "/"))
|
||||||
|
|
||||||
// Class files
|
// Class files
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue