Comments (3)
Can you try the instructions provided in the README? If they work for you I will merge the PR, or adjust it until it is clear.
from klock.
Thanks! Now it works.
In the beginning I thought that commonMainApi, jvmMainApi, jsMainApi were functions of gradle that were doing some magic instead of 'implementation' but It wasn't so.
So I just used 'implementation' instead of them.
I will paste here my working build.gradle (in the hope it can be helpful to others)
buildscript {
repositories {
jcenter()
}
}
plugins {
id 'kotlin-multiplatform' version '1.3.21'
}
repositories {
jcenter()
maven { url "http://dl.bintray.com/kotlin/ktor" }
mavenCentral()
maven { url "https://dl.bintray.com/soywiz/soywiz" }
}
def ktor_version = '1.0.1'
def logback_version = '1.2.3'
def klockVersion = "1.3.1"
kotlin {
jvm()
js() {
compilations.all {
kotlinOptions {
languageVersion = "1.3"
moduleKind = "umd"
sourceMap = true
metaInfo = true
}
}
}
sourceSets {
commonMain {
dependencies {
implementation kotlin('stdlib-common')
implementation "com.soywiz:klock-metadata:$klockVersion"
}
}
commonTest {
dependencies {
implementation kotlin('test-common')
implementation kotlin('test-annotations-common')
}
}
jvmMain {
dependencies {
implementation kotlin('stdlib-jdk8')
implementation "io.ktor:ktor-server-netty:$ktor_version"
implementation "io.ktor:ktor-html-builder:$ktor_version"
implementation "ch.qos.logback:logback-classic:$logback_version"
implementation 'net.sf.biweekly:biweekly:0.6.3'
implementation "com.soywiz:klock-jvm:$klockVersion"
}
}
jvmTest {
dependencies {
implementation kotlin('test')
implementation kotlin('test-junit')
}
}
jsMain {
dependencies {
implementation kotlin('stdlib-js')
implementation "com.soywiz:klock-js:$klockVersion"
}
}
jsTest {
dependencies {
implementation kotlin('test-js')
}
}
}
}
def webFolder = new File(project.buildDir, "../src/jsMain/web")
def jsCompilations = kotlin.targets.js.compilations
task populateWebFolder(dependsOn: [jsMainClasses]) {
doLast {
copy {
from jsCompilations.main.output
from kotlin.sourceSets.jsMain.resources.srcDirs
jsCompilations.test.runtimeDependencyFiles.each {
if (it.exists() && !it.isDirectory()) {
from zipTree(it.absolutePath).matching { include '*.js' }
}
}
into webFolder
}
}
}
jsJar.dependsOn(populateWebFolder)
task run(type: JavaExec, dependsOn: [jvmMainClasses, jsJar]) {
main = "sample.SampleJvmKt"
classpath { [
kotlin.targets.jvm.compilations.main.output.allOutputs.files,
configurations.jvmRuntimeClasspath,
] }
args = []
}
from klock.
I have pretty much the same build.gradle as @simonegiacomelli . However, I also have the iOS source set, which is combined into iOSMain:
iOSMain.dependencies {
implementation "io.ktor:ktor-client-ios:$ktor_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-native:$coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:$serialization_version"
}
configure([ios_arm64Main, ios_x86_64Main]) {
dependsOn iOSMain
}
Adding Klock -iosx64 breaks iosarm64 build and vice-versa.
What would be the correct way to include Klock for iOS simulator (x64) and real device (arm64) in the example above?
from klock.
Related Issues (20)
- Cannot find symbol when using library from Java HOT 8
- Get locale of device HOT 1
- Format DateTimeTz HOT 7
- Deployment to Maven Central HOT 3
- add infix to functions? HOT 2
- Android java.lang.NoSuchMethodError HOT 3
- Jcenter is being sunsetted HOT 1
- How to handle daylight saving time? HOT 2
- Regex Breaks in Kotlin 1.5 HOT 2
- Strange casting of DateTime in runtime HOT 3
- Legacy JS support removed - intentional? HOT 5
- Doesn't have release version klock:klock-android HOT 1
- Where is the latest codes? HOT 3
- Update up to 1.6.0? HOT 4
- Adding support to iosSimulatorArm64 architecture HOT 4
- Missing watchosX64 artifacts in latest version 2.4.12 HOT 9
- Occasional bug in date formatter HOT 4
- Network error, ignore this
- Network error, ignore this
- Chinese Locale still use "am/pm" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from klock.