Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
skiko
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liuqiang
skiko
Commits
3647cb87
Unverified
Commit
3647cb87
authored
Jan 16, 2021
by
Nikolay Igotti
Committed by
GitHub
Jan 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make compilation more cross-friendly. (#43)
parent
91e9bd02
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
13 deletions
+23
-13
build.gradle.kts
skiko/build.gradle.kts
+7
-10
properties.kt
skiko/buildSrc/src/main/kotlin/properties.kt
+16
-3
No files found.
skiko/build.gradle.kts
View file @
3647cb87
...
@@ -36,12 +36,12 @@ repositories {
...
@@ -36,12 +36,12 @@ repositories {
}
}
val
skiaZip
=
run
{
val
skiaZip
=
run
{
val
zipName
=
skiko
.
skiaReleaseFor
Curren
tOS
+
".zip"
val
zipName
=
skiko
.
skiaReleaseFor
Targe
tOS
+
".zip"
val
zipFile
=
skiko
.
dependenciesDir
.
resolve
(
"skia/${zipName.substringAfterLast('/')}"
)
val
zipFile
=
skiko
.
dependenciesDir
.
resolve
(
"skia/${zipName.substringAfterLast('/')}"
)
tasks
.
register
(
"downloadSkia"
,
Download
::
class
)
{
tasks
.
register
(
"downloadSkia"
,
Download
::
class
)
{
onlyIf
{
skiko
.
skiaDir
==
null
&&
!
zipFile
.
exists
()
}
onlyIf
{
skiko
.
skiaDir
==
null
&&
!
zipFile
.
exists
()
}
inputs
.
property
(
"skia.release.for.
current.os"
,
skiko
.
skiaReleaseForCurren
tOS
)
inputs
.
property
(
"skia.release.for.
target.os"
,
skiko
.
skiaReleaseForTarge
tOS
)
src
(
"https://github.com/JetBrains/skia-build/releases/download/$zipName"
)
src
(
"https://github.com/JetBrains/skia-build/releases/download/$zipName"
)
dest
(
zipFile
)
dest
(
zipFile
)
onlyIfModified
(
true
)
onlyIfModified
(
true
)
...
@@ -117,8 +117,6 @@ val skijaDir = run {
...
@@ -117,8 +117,6 @@ val skijaDir = run {
}
}
}
}
val
lombok
by
configurations
.
creating
val
lombok
by
configurations
.
creating
val
jetbrainsAnnotations
by
configurations
.
creating
val
jetbrainsAnnotations
by
configurations
.
creating
dependencies
{
dependencies
{
...
@@ -434,9 +432,9 @@ val skikoJvmJar: Provider<Jar> by tasks.registering(Jar::class) {
...
@@ -434,9 +432,9 @@ val skikoJvmJar: Provider<Jar> by tasks.registering(Jar::class) {
}
}
val
createChecksums
by
project
.
tasks
.
registering
(
org
.
gradle
.
crypto
.
checksum
.
Checksum
::
class
)
{
val
createChecksums
by
project
.
tasks
.
registering
(
org
.
gradle
.
crypto
.
checksum
.
Checksum
::
class
)
{
val
linkTask
=
project
.
tasks
.
named
(
"link${buildType.id}${targetOs.id.capitalize()}"
)
val
linkTask
=
project
.
tasks
.
withType
(
LinkSharedLibrary
::
class
.
java
).
single
{
it
.
name
.
contains
(
buildType
.
id
)
}
dependsOn
(
linkTask
)
dependsOn
(
linkTask
)
files
=
linkTask
.
get
().
outputs
.
files
.
filter
{
it
.
isFile
}
+
files
=
linkTask
.
outputs
.
files
.
filter
{
it
.
isFile
}
+
if
(
targetOs
.
isWindows
)
files
(
skiaDir
.
map
{
it
.
resolve
(
"out/${buildType.id}-x64/icudtl.dat"
)
})
else
files
()
if
(
targetOs
.
isWindows
)
files
(
skiaDir
.
map
{
it
.
resolve
(
"out/${buildType.id}-x64/icudtl.dat"
)
})
else
files
()
algorithm
=
Checksum
.
Algorithm
.
SHA256
algorithm
=
Checksum
.
Algorithm
.
SHA256
outputDir
=
file
(
"$buildDir/checksums"
)
outputDir
=
file
(
"$buildDir/checksums"
)
...
@@ -446,9 +444,8 @@ val skikoJvmRuntimeJar by project.tasks.registering(Jar::class) {
...
@@ -446,9 +444,8 @@ val skikoJvmRuntimeJar by project.tasks.registering(Jar::class) {
archiveBaseName
.
set
(
"skiko-$target"
)
archiveBaseName
.
set
(
"skiko-$target"
)
dependsOn
(
createChecksums
)
dependsOn
(
createChecksums
)
from
(
skikoJvmJar
.
map
{
zipTree
(
it
.
archiveFile
)
})
from
(
skikoJvmJar
.
map
{
zipTree
(
it
.
archiveFile
)
})
from
(
project
.
tasks
.
named
(
"link${buildType.id}${targetOs.id.capitalize()}"
).
map
{
val
linkTask
=
project
.
tasks
.
withType
(
LinkSharedLibrary
::
class
.
java
).
single
{
it
.
name
.
contains
(
buildType
.
id
)
}
it
.
outputs
.
files
.
filter
{
it
.
isFile
}
from
(
linkTask
).
outputs
.
files
.
filter
{
it
.
isFile
}
})
if
(
targetOs
.
isWindows
)
{
if
(
targetOs
.
isWindows
)
{
from
(
files
(
skiaDir
.
map
{
it
.
resolve
(
"out/${buildType.id}-x64/icudtl.dat"
)
}))
from
(
files
(
skiaDir
.
map
{
it
.
resolve
(
"out/${buildType.id}-x64/icudtl.dat"
)
}))
}
}
...
@@ -552,7 +549,7 @@ publishing {
...
@@ -552,7 +549,7 @@ publishing {
}
}
}
}
create
<
MavenPublication
>(
"skikoJvmRuntime"
)
{
create
<
MavenPublication
>(
"skikoJvmRuntime"
)
{
artifactId
=
SkikoArtifacts
.
runtimeArtifactIdFor
(
hostOs
,
hos
tArch
)
artifactId
=
SkikoArtifacts
.
runtimeArtifactIdFor
(
targetOs
,
targe
tArch
)
afterEvaluate
{
afterEvaluate
{
artifact
(
skikoJvmRuntimeJar
.
map
{
it
.
archiveFile
.
get
()
})
artifact
(
skikoJvmRuntimeJar
.
map
{
it
.
archiveFile
.
get
()
})
}
}
...
...
skiko/buildSrc/src/main/kotlin/properties.kt
View file @
3647cb87
...
@@ -47,8 +47,21 @@ val hostArch by lazy {
...
@@ -47,8 +47,21 @@ val hostArch by lazy {
}
}
}
}
val
targetOs
=
hostOs
fun
findTargetOs
()
=
when
(
System
.
getProperty
(
"skiko.target.os.name"
))
{
val
targetArch
=
hostArch
"linux"
->
OS
.
Linux
"macos"
->
OS
.
MacOS
"windows"
->
OS
.
Windows
else
->
null
}
fun
findTargetArch
()
=
when
(
System
.
getProperty
(
"skiko.target.os.arch"
))
{
"x64"
->
Arch
.
X64
"arm64"
->
Arch
.
Arm64
else
->
null
}
val
targetOs
=
findTargetOs
()
?:
hostOs
val
targetArch
=
findTargetArch
()
?:
hostArch
val
target
=
targetId
(
targetOs
,
targetArch
)
val
target
=
targetId
(
targetOs
,
targetArch
)
...
@@ -73,7 +86,7 @@ class SkikoProperties(private val myProject: Project) {
...
@@ -73,7 +86,7 @@ class SkikoProperties(private val myProject: Project) {
val
skijaCommitHash
:
String
val
skijaCommitHash
:
String
get
()
=
myProject
.
property
(
"dependencies.skija.git.commit"
)
as
String
get
()
=
myProject
.
property
(
"dependencies.skija.git.commit"
)
as
String
val
skiaReleaseFor
Curren
tOS
:
String
val
skiaReleaseFor
Targe
tOS
:
String
get
()
=
(
myProject
.
property
(
"dependencies.skia.$target"
)
as
String
)
get
()
=
(
myProject
.
property
(
"dependencies.skia.$target"
)
as
String
)
val
releaseGithubVersion
:
String
val
releaseGithubVersion
:
String
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment