Jake
06/20/2019, 7:10 PMDominaezzz
06/20/2019, 7:12 PMDominaezzz
06/20/2019, 7:13 PMpublishToMavenLocal
.Dominaezzz
06/20/2019, 7:16 PMmavenLocal()
repo in project3
.Jake
06/20/2019, 7:48 PM.klib
would only be available for the ios
project in project3. For the other’s I’d still need to use the .jar
files right?
I haven’t seen a common
dependency that generates.Dominaezzz
06/20/2019, 8:05 PMDominaezzz
06/20/2019, 8:05 PMJake
06/20/2019, 8:08 PMDominaezzz
06/20/2019, 8:09 PMJake
06/20/2019, 8:15 PMbuildscript {
ext.ios_framework_name = 'KSynapseModels'
ext.serialization_version = "0.11.0"
ext.kotlin_version = '1.3.31'
ext.kotlinx_version = '1.3.30'
}
plugins {
id 'kotlin-multiplatform' version '1.3.31'
id 'kotlinx-serialization' version '1.3.30'
}
repositories {
mavenCentral()
jcenter()
maven { url "<https://kotlin.bintray.com/kotlinx>" }
}
group 'com.jacob.rakidzich'
version '0.0.1'
apply plugin: 'maven-publish'
kotlin {
// jvm()
targets {
fromPreset(presets.jvm, 'jvm')
fromPreset(presets.iosX64, 'ios') {
binaries {
framework("$ios_framework_name") {
embedBitcode('disable')
}
}
}
}
sourceSets {
commonMain {
dependencies {
implementation kotlin('stdlib-common')
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:$serialization_version"
}
}
commonTest {
dependencies {
implementation kotlin('test-common')
implementation kotlin('test-annotations-common')
}
}
jvmMain {
dependencies {
implementation kotlin('stdlib')
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime:$serialization_version"
}
}
jvmTest {
dependencies {
implementation kotlin('test')
implementation kotlin('test-junit')
}
}
iosMain {
dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:$serialization_version"
}
}
iosTest {
}
}
}
task packForXCode {
final File frameworkDir = new File(buildDir, "xcode-frameworks")
final String buildType = project.findProperty("XCODE_CONFIGURATION")?.toUpperCase() ?: 'DEBUG'
def keyFrameworkPrefix = "$ios_framework_name${buildType.toLowerCase().capitalize()}"
dependsOn "link${keyFrameworkPrefix}FrameworkIos"
doLast {
def srcFile = kotlin.targets.ios.binaries.getFramework("$ios_framework_name", buildType).outputFile
copy {
from srcFile.parent
into frameworkDir
}
new File(frameworkDir, 'gradlew').with {
text = "#!/bin/bash\nexport 'JAVA_HOME=${System.getProperty("java.home")}'\ncd '${rootProject.rootDir}'\n./gradlew \$@\n"
setExecutable(true)
}
}
}
tasks.build.dependsOn packForXCode
configurations {
compileClasspath
}
Dominaezzz
06/20/2019, 8:18 PMJake
06/20/2019, 8:19 PMpluginManagement {
resolutionStrategy {
eachPlugin {
if (requested.id.id == "kotlin-multiplatform") {
useModule("org.jetbrains.kotlin:kotlin-gradle-plugin:${requested.version}")
}
if (requested.id.id == "kotlinx-serialization") {
useModule("org.jetbrains.kotlin:kotlin-serialization:${requested.version}")
}
}
}
}
rootProject.name = 'KSynapseModels'
enableFeaturePreview('GRADLE_METADATA')
Jake
06/20/2019, 8:19 PMDominaezzz
06/20/2019, 8:21 PM.m2
folder in your home directory look like? Does it have the jars and libs?Jake
06/20/2019, 8:22 PMJake
06/20/2019, 8:23 PMJake
06/20/2019, 8:24 PMDominaezzz
06/20/2019, 8:25 PMDominaezzz
06/20/2019, 8:25 PMJake
06/20/2019, 8:25 PMDominaezzz
06/20/2019, 8:25 PMDominaezzz
06/20/2019, 8:25 PMDominaezzz
06/20/2019, 8:26 PMproject3
?Jake
06/20/2019, 8:26 PMJake
06/20/2019, 8:26 PMDominaezzz
06/20/2019, 8:29 PMJake
06/20/2019, 8:29 PMJake
06/20/2019, 8:29 PMDominaezzz
06/20/2019, 8:32 PMDominaezzz
06/20/2019, 8:32 PMJake
06/20/2019, 8:32 PMDominaezzz
06/20/2019, 8:32 PMJake
06/20/2019, 8:33 PMDominaezzz
06/20/2019, 8:33 PMJake
06/25/2019, 11:55 AMCould not find
in my gradle build output.
I’m using maven local
implementation "/Users/xxxx/.m2/repository/com/jacob/rakidzich/KSynapseModels:$k_synapse_models_version"
I’ve also tried to include the url in the required repositories
maven { url "/Users/xxxx/.m2/repository/com/jacob/rakidzich" }
I’ve been searching online but I’m not seeing what I’m looking for. Do you have any insight?Dominaezzz
06/25/2019, 2:18 PMDominaezzz
06/25/2019, 2:19 PMmavenLocal()
to your repositories block.Jake
06/25/2019, 2:19 PMJake
06/25/2019, 2:20 PMDominaezzz
06/25/2019, 2:20 PMimplementation "com.jacob.rakidzich:KSynapseModels:0.0.1"
.Jake
06/25/2019, 2:29 PM.
instead of a :
before KSynapseModels
Jake
06/25/2019, 2:29 PMDominaezzz
06/25/2019, 4:07 PMJake
06/25/2019, 4:07 PMDominaezzz
06/25/2019, 4:08 PM