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
1ef83d20
Unverified
Commit
1ef83d20
authored
Dec 07, 2020
by
Nikolay Igotti
Committed by
GitHub
Dec 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Distinct name for platform artifacts. (#29)
parent
f7519166
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
20 deletions
+42
-20
build.gradle.kts
skiko/build.gradle.kts
+1
-1
Library.kt
skiko/src/jvmMain/kotlin/org/jetbrains/skiko/Library.kt
+2
-2
OSType.kt
skiko/src/jvmMain/kotlin/org/jetbrains/skiko/OSType.kt
+0
-17
OsArch.kt
skiko/src/jvmMain/kotlin/org/jetbrains/skiko/OsArch.kt
+39
-0
No files found.
skiko/build.gradle.kts
View file @
1ef83d20
...
...
@@ -346,7 +346,7 @@ extensions.configure<CppLibrary> {
library
{
linkage
.
addAll
(
listOf
(
Linkage
.
SHARED
))
targetMachines
.
addAll
(
listOf
(
machines
.
macOS
.
x86_64
,
machines
.
linux
.
x86_64
,
machines
.
windows
.
x86_64
))
baseName
.
set
(
"skiko"
)
baseName
.
set
(
"skiko
-$target
"
)
dependencies
{
implementation
(
...
...
skiko/src/jvmMain/kotlin/org/jetbrains/skiko/Library.kt
View file @
1ef83d20
...
...
@@ -35,7 +35,7 @@ object Library {
if
(
loaded
)
return
val
resourcePath
=
"/"
val
name
=
"skiko"
val
name
=
"skiko
-$hostId
"
val
platformName
=
System
.
mapLibraryName
(
name
)
val
hash
=
Library
::
class
.
java
.
getResourceAsStream
(
"$resourcePath$platformName.sha256"
).
use
{
...
...
@@ -44,7 +44,7 @@ object Library {
val
cacheDir
=
File
(
"$cacheRoot/$hash"
)
cacheDir
.
mkdirs
()
loadOrGet
(
cacheDir
,
resourcePath
,
platformName
,
true
)
val
loadIcu
=
OSType
.
currentOs
==
OSType
.
WINDOWS
val
loadIcu
=
hostOs
.
isWindows
if
(
loadIcu
)
{
loadOrGet
(
cacheDir
,
resourcePath
,
"icudtl.dat"
,
false
)
}
...
...
skiko/src/jvmMain/kotlin/org/jetbrains/skiko/OSType.kt
deleted
100644 → 0
View file @
f7519166
package
org.jetbrains.skiko
enum
class
OSType
{
MAC_OS
,
LINUX
,
WINDOWS
,
UNKNOWN
;
companion
object
{
val
currentOs
by
lazy
{
val
name
=
System
.
getProperty
(
"os.name"
).
toLowerCase
()
when
{
name
.
indexOf
(
"win"
)
>=
0
->
WINDOWS
name
.
indexOf
(
"mac"
)
>=
0
->
MAC_OS
name
.
indexOf
(
"linux"
)
>=
0
->
LINUX
else
->
UNKNOWN
}
}
}
}
\ No newline at end of file
skiko/src/jvmMain/kotlin/org/jetbrains/skiko/OsArch.kt
0 → 100644
View file @
1ef83d20
package
org.jetbrains.skiko
enum
class
OS
(
val
id
:
String
)
{
Linux
(
"linux"
),
Windows
(
"windows"
),
MacOS
(
"macos"
)
;
val
isWindows
get
()
=
this
==
Windows
}
enum
class
Arch
(
val
id
:
String
)
{
X64
(
"x64"
),
Arm64
(
"arm64"
)
}
val
hostOs
by
lazy
{
val
osName
=
System
.
getProperty
(
"os.name"
)
when
{
osName
==
"Mac OS X"
->
OS
.
MacOS
osName
==
"Linux"
->
OS
.
Linux
osName
.
startsWith
(
"Win"
)
->
OS
.
Windows
else
->
throw
Error
(
"Unknown OS $osName"
)
}
}
val
hostArch
by
lazy
{
val
osArch
=
System
.
getProperty
(
"os.arch"
)
when
(
osArch
)
{
"x86_64"
,
"amd64"
->
Arch
.
X64
"aarch64"
->
Arch
.
Arm64
else
->
throw
Error
(
"Unknown arch $osArch"
)
}
}
val
hostId
by
lazy
{
"${hostOs.id}-${hostArch.id}"
}
\ No newline at end of file
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