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
9d621e5c
Commit
9d621e5c
authored
Jan 29, 2021
by
Igor Demin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert SkijaInjectSample to Gradle Kotlin DSL
parent
948b1b74
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
79 additions
and
91 deletions
+79
-91
build.gradle
samples/SkijaInjectSample/build.gradle
+0
-71
build.gradle.kts
samples/SkijaInjectSample/build.gradle.kts
+67
-0
settings.gradle
samples/SkijaInjectSample/settings.gradle
+0
-20
settings.gradle.kts
samples/SkijaInjectSample/settings.gradle.kts
+12
-0
No files found.
samples/SkijaInjectSample/build.gradle
deleted
100644 → 0
View file @
948b1b74
plugins
{
id
'org.jetbrains.kotlin.jvm'
version
'1.3.72'
id
'application'
}
repositories
{
mavenLocal
()
jcenter
()
maven
{
url
'https://dl.bintray.com/kotlin/kotlin-eap'
}
maven
{
url
'https://maven.pkg.jetbrains.space/public/p/compose/dev'
}
}
def
osName
=
System
.
getProperty
(
"os.name"
)
def
targetOs
=
""
if
(
osName
==
"Mac OS X"
)
{
targetOs
=
"macos"
}
else
if
(
osName
.
startsWith
(
"Win"
))
{
targetOs
=
"windows"
}
else
if
(
osName
.
startsWith
(
"Linux"
))
{
targetOs
=
"linux"
}
else
{
throw
Error
(
"Unsupported OS: $osName"
)
}
def
osArch
=
System
.
getProperty
(
"os.arch"
)
def
targetArch
=
""
if
(
osArch
==
"x86_64"
||
osArch
==
"amd64"
)
{
targetArch
=
"x64"
}
else
if
(
osArch
==
"aarch64"
)
{
targetArch
=
"arm64"
}
else
{
throw
Error
(
"Unsupported arch: $osArch"
)
}
def
target
=
"${targetOs}-${targetArch}"
def
version
=
"0.0.0-SNAPSHOT"
if
(
project
.
hasProperty
(
'skiko.version'
))
{
version
=
project
.
properties
[
'skiko.version'
]
}
dependencies
{
implementation
platform
(
'org.jetbrains.kotlin:kotlin-bom'
)
implementation
'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
implementation
'org.jetbrains.kotlinx:kotlinx-coroutines-swing:1.4.1'
implementation
"org.jetbrains.skiko:skiko-jvm-runtime-$target:$version"
testImplementation
'org.jetbrains.kotlin:kotlin-test'
testImplementation
'org.jetbrains.kotlin:kotlin-test-junit'
}
application
{
mainClassName
=
'SkijaInjectSample.AppKt'
}
run
{
systemProperty
(
"skiko.fps.enabled"
,
"true"
)
systemProperties
(
System
.
properties
)
}
test
{
systemProperty
(
"skiko.test.screenshots.dir"
,
new
File
(
project
.
projectDir
,
"src/test/screenshots"
).
absolutePath
)
// Tests should be deterministic, so disable scaling.
// On MacOs we need the actual scale, otherwise we will have aliased screenshots because of scaling.
if
(
System
.
getProperty
(
"os.name"
)
!=
"Mac OS X"
)
{
systemProperty
(
"sun.java2d.dpiaware"
,
"false"
)
systemProperty
(
"sun.java2d.uiScale"
,
"1"
)
}
}
\ No newline at end of file
samples/SkijaInjectSample/build.gradle.kts
0 → 100644
View file @
9d621e5c
plugins
{
kotlin
(
"jvm"
)
version
"1.3.72"
application
}
repositories
{
mavenLocal
()
jcenter
()
maven
(
"https://dl.bintray.com/kotlin/kotlin-eap"
)
maven
(
"https://maven.pkg.jetbrains.space/public/p/compose/dev"
)
}
val
osName
=
System
.
getProperty
(
"os.name"
)
val
targetOs
=
when
{
osName
==
"Mac OS X"
->
"macos"
osName
.
startsWith
(
"Win"
)
->
"windows"
osName
.
startsWith
(
"Linux"
)
->
"linux"
else
->
error
(
"Unsupported OS: $osName"
)
}
val
osArch
=
System
.
getProperty
(
"os.arch"
)
var
targetArch
=
when
(
osArch
)
{
"x86_64"
,
"amd64"
->
"x64"
"aarch64"
->
"arm64"
else
->
error
(
"Unsupported arch: $osArch"
)
}
val
target
=
"${targetOs}-${targetArch}"
var
version
=
"0.0.0-SNAPSHOT"
if
(
project
.
hasProperty
(
"skiko.version"
))
{
version
=
project
.
properties
[
"skiko.version"
]
as
String
}
dependencies
{
implementation
(
platform
(
"org.jetbrains.kotlin:kotlin-bom"
))
implementation
(
"org.jetbrains.kotlin:kotlin-stdlib-jdk8"
)
implementation
(
"org.jetbrains.kotlinx:kotlinx-coroutines-swing:1.4.1"
)
implementation
(
"org.jetbrains.skiko:skiko-jvm-runtime-$target:$version"
)
testImplementation
(
"org.jetbrains.kotlin:kotlin-test"
)
testImplementation
(
"org.jetbrains.kotlin:kotlin-test-junit"
)
}
application
{
mainClass
.
set
(
"SkijaInjectSample.AppKt"
)
}
tasks
.
named
<
JavaExec
>(
"run"
)
{
systemProperty
(
"skiko.fps.enabled"
,
"true"
)
System
.
getProperties
().
entries
.
associate
{
(
it
.
key
as
String
)
to
(
it
.
value
as
String
)
}
.
filterKeys
{
it
.
startsWith
(
"skiko."
)
}
.
forEach
{
systemProperty
(
it
.
key
,
it
.
value
)
}
}
tasks
.
withType
<
Test
>
{
systemProperty
(
"skiko.test.screenshots.dir"
,
File
(
project
.
projectDir
,
"src/test/screenshots"
).
absolutePath
)
// Tests should be deterministic, so disable scaling.
// On MacOs we need the actual scale, otherwise we will have aliased screenshots because of scaling.
if
(
System
.
getProperty
(
"os.name"
)
!=
"Mac OS X"
)
{
systemProperty
(
"sun.java2d.dpiaware"
,
"false"
)
systemProperty
(
"sun.java2d.uiScale"
,
"1"
)
}
}
\ No newline at end of file
samples/SkijaInjectSample/settings.gradle
deleted
100644 → 0
View file @
948b1b74
/*
* This file was generated by the Gradle 'init' task.
*
* The settings file is used to specify which projects to include in your build.
*
* Detailed information about configuring a multi-project build in Gradle can be found
* in the user manual at https://docs.gradle.org/6.5/userguide/multi_project_builds.html
*/
pluginManagement
{
repositories
{
mavenCentral
()
gradlePluginPortal
()
maven
{
url
"https://dl.bintray.com/kotlin/kotlin-eap"
}
}
}
rootProject
.
name
=
'SkijaInjectSample'
samples/SkijaInjectSample/settings.gradle.kts
0 → 100644
View file @
9d621e5c
pluginManagement
{
repositories
{
mavenCentral
()
gradlePluginPortal
()
maven
{
url
=
uri
(
"https://dl.bintray.com/kotlin/kotlin-eap"
)
}
}
}
rootProject
.
name
=
"SkijaInjectSample"
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