Skip to content

Commit

Permalink
Simplify build config, allow debug builds. (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
olonho authored Jul 8, 2021
1 parent e0efcde commit 1dd4bdc
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ To use latest development snapshot use version `0.0.0-SNAPSHOT`.
* Set JAVA_HOME to location of JDK, at least version 11
* `cd skiko && ./gradlew publishToMavenLocal` will build the artefact and publish it to local Maven repo

To build with debug symbols and debug Skia build use `-Pskiko.debug=true` Gradle argument.

#### Working with Skia or Skija sources

Gradle build downloads the necessary version of Skia & Skija by default.
Expand Down
3 changes: 1 addition & 2 deletions skiko/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ buildscript {
}

val skiko = SkikoProperties(rootProject)
val debug = false
val buildType = if (debug) SkiaBuildType.DEBUG else SkiaBuildType.RELEASE
val buildType = skiko.buildType

allprojects {
group = "org.jetbrains.skiko"
Expand Down
13 changes: 12 additions & 1 deletion skiko/buildSrc/src/main/kotlin/properties.kt
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,22 @@ class SkikoProperties(private val myProject: Project) {
val isRelease: Boolean
get() = myProject.findProperty("deploy.release") == "true"

val buildType: SkiaBuildType
get() = if (myProject.findProperty("skiko.debug") == "true") SkiaBuildType.DEBUG else SkiaBuildType.RELEASE

val skijaCommitHash: String
get() = myProject.property("dependencies.skija.git.commit") as String

val skiaReleaseForTargetOS: String
get() = (myProject.property("dependencies.skia.$target") as String)
get() {
val tag = myProject.property("dependencies.skia.$target") as String
val suffix = if (targetOs == OS.Linux && targetArch == Arch.X64) {
"-ubuntu14"
} else {
""
}
return "${tag}/Skia-${tag}-${targetOs.id}-${buildType.id}-${targetArch.id}$suffix"
}

val releaseGithubVersion: String
get() = (myProject.property("release.github.version") as String)
Expand Down
10 changes: 5 additions & 5 deletions skiko/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ deploy.version=0.0.0
kotlin.native.version=1.5.10-eap-85

dependencies.skija.git.commit=37d3d6ec1dabf0528f4fcc2bcbe16f4c9b3f196b
dependencies.skia.windows-x64=m92-81ce29695f/Skia-m92-81ce29695f-windows-Release-x64
dependencies.skia.linux-x64=m92-81ce29695f/Skia-m92-81ce29695f-linux-Release-x64-ubuntu14
dependencies.skia.macos-x64=m92-81ce29695f/Skia-m92-81ce29695f-macos-Release-x64
dependencies.skia.linux-arm64=m92-81ce29695f/Skia-m92-81ce29695f-linux-Release-arm64
dependencies.skia.macos-arm64=m92-81ce29695f/Skia-m92-81ce29695f-macos-Release-arm64
dependencies.skia.windows-x64=m92-81ce29695f
dependencies.skia.linux-x64=m92-81ce29695f
dependencies.skia.macos-x64=m92-81ce29695f
dependencies.skia.linux-arm64=m92-81ce29695f
dependencies.skia.macos-arm64=m92-81ce29695f

0 comments on commit 1dd4bdc

Please sign in to comment.