Unresolved reference trying to build .aar with kotlin mpp - android

I am trying to get https://github.com/Kotlin/kotlinx.serialization to work with my android library I am building using kotlin mpp. This is my gradle file
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
plugins {
id("com.android.library")
id("org.jetbrains.kotlin.multiplatform")
kotlin("plugin.serialization") version "1.3.61"
}
group = "org.greeting"
version = 1.0
android {
compileSdkVersion(27)
defaultConfig {
minSdkVersion(15)
}
buildTypes {
getByName("release") {
isMinifyEnabled = true
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}
}
dependencies {
// Specify Kotlin/JVM stdlib dependency.
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7")
implementation(kotlin("stdlib", org.jetbrains.kotlin.config.KotlinCompilerVersion.VERSION)) // or "stdlib-jdk8"
implementation("org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.14.0") // JVM dependency
testImplementation("junit:junit:4.12")
testImplementation("org.jetbrains.kotlin:kotlin-test")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
androidTestImplementation("junit:junit:4.12")
androidTestImplementation("org.jetbrains.kotlin:kotlin-test")
androidTestImplementation("org.jetbrains.kotlin:kotlin-test-junit")
}
kotlin {
android("androidLib")
val buildForDevice = project.findProperty("device") as? Boolean ?: false
val iosTarget = if (buildForDevice) iosArm64("ios") else iosX64("ios")
iosTarget.binaries {
framework {
// Disable bitcode embedding for the simulator build.
if (!buildForDevice) {
embedBitcode("disable")
}
}
}
sourceSets["androidLibMain"].dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.14.0")
}
sourceSets {
commonMain {
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-common")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:0.14.0")
}
}
commonTest {
dependencies {
implementation("org.jetbrains.kotlin:kotlin-test-common")
implementation("org.jetbrains.kotlin:kotlin-test-annotations-common")
}
}
}
}
tasks.register("copyFramework") {
val buildType = project.findProperty("kotlin.build.type") as? String ?: "DEBUG"
dependsOn("link${buildType.toLowerCase().capitalize()}FrameworkIos")
doLast {
val srcFile = (kotlin.targets["ios"] as KotlinNativeTarget).binaries.getFramework(buildType).outputFile
val targetDir = project.property("configuration.build.dir")!!
copy {
from(srcFile.parent)
into(targetDir)
include("greeting.framework/**")
include("greeting.framework.dSYM")
}
}
}
tasks.register("iosTest") {
val device = project.findProperty("iosDevice") as? String ?: "iPhone 8"
dependsOn("linkDebugTestIos")
group = JavaBasePlugin.VERIFICATION_GROUP
description = "Runs tests for target 'ios' on an iOS simulator"
doLast {
val binary = (kotlin.targets["ios"] as KotlinNativeTarget).binaries.getTest("DEBUG").outputFile
exec {
commandLine("xcrun", "simctl", "spawn", "--standalone", device, binary.absolutePath)
}
}
}
When I try to run build i get Unresolved reference: serialization on line import kotlinx.serialization.ImplicitReflectionSerializer; But if compile the androidTests the linking works fine. Strangely i have to do sourceSets["androidLibMain"] and can't include it in the sourceSet{} block not sure if this is related. Any ideas on why the build task is not linking my serialization library? Thanks

Related

EasyLauncherConfig with name 'debug' not found

I'm using easylaucher library Easylaucher library to add a ribbon on the app icon. I'm using kotlin DSL but when I apply the easy laucher configurations it throws EasyLauncherConfig with name 'debug' not found.
Here is my configuration
plugins {
id("kotlin-android")
id(BuildPlugins.androidApplication)
id("com.starter.easylauncher") version "5.1.2"
}
android {
//...
}
dependencies {
//...
}
easylauncher {
buildTypes{
getByName("debug") {
filters(
customRibbon(label = "Debug", ribbonColor = "#FF0000")
)
}
getByName("release") {
filters(
customRibbon(label = "BETA", ribbonColor = "#F18357")
)
}
}
}
Anyone with a good solution to this?
I found the solution. Instead of using getByName(...) I used register(...)
easylauncher {
buildTypes{
register("debug") {
filters(
customRibbon(label = "Debug", ribbonColor = "#FF0000")
)
}
register("release") {
filters(
customRibbon(label = "BETA", ribbonColor = "#F18357")
)
}
}
}

Why mono-socketio is not connected to Socket?

I used Moko-socketio library to handle the socket in our multiplatform app but when I run the app, The socket is not connected.
This is logcat error:
error io.socket.engineio.client.EngineIOException: websocket error
error io.socket.client.SocketIOException: Connection error
Note: I used the sample moko-socketio codes for testing.
project build.gradle.kts:
buildscript {
repositories {
gradlePluginPortal()
google()
mavenCentral()
maven {
url = uri("https://plugins.gradle.org/m2/")
}
}
dependencies {
classpath(Build.kotlinGradlePlugin)
classpath(Build.buildTools)
classpath(Build.sqlDelightGradlePlugin)
classpath("dev.icerock:mobile-multiplatform:0.14.2")
}
}
plugins {
//trick: for the same plugin versions in all sub-modules
id(KotlinPlugins.comAndroidApplication).version(KotlinPlugins.version).apply(false)
id(KotlinPlugins.comAndroidLibrary).version(KotlinPlugins.version).apply(false)
id(Plugins.sqlDelight).version(SQLDelight.sqlDelightVersion).apply(false)
id("dev.icerock.mobile.multiplatform.cocoapods").version("0.14.2").apply(false)
kotlin(KotlinPlugins.android).version(Kotlin.version).apply(false)
kotlin(KotlinPlugins.multiplatform).version(Kotlin.version).apply(false)
}
allprojects {
repositories {
google()
mavenCentral()
}
}
tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
}
Shared build.gradle.kts:
plugins {
kotlin("native.cocoapods")
kotlin(KotlinPlugins.multiplatform)
id(KotlinPlugins.comAndroidLibrary)
kotlin(KotlinPlugins.serialization) version Kotlin.version
id(Plugins.sqlDelight)
id("dev.icerock.mobile.multiplatform.cocoapods")
id("dev.icerock.mobile.multiplatform.ios-framework")
}
kotlin {
android()
iosX64()
iosArm64()
iosSimulatorArm64()
cocoapods {
summary = "Some description for the Shared Module"
homepage = "Link to the Shared Module homepage"
version = "1.0"
ios.deploymentTarget = "14.1"
podfile = project.file("../iosApp/Podfile")
framework {
baseName = "shared"
}
}
sourceSets {
val commonMain by getting {
dependencies {
with(Koin) {
implementation(koinCore)
implementation(koinTest)
}
with(Coroutines) {
implementation(coreCoroutines)
}
with(Ktor) {
implementation(core)
implementation(ktorClientContentNegotiation)
implementation(ktorSerializationJson)
}
with(SQLDelight) {
implementation(runtime)
}
}
}
val commonTest by getting {
dependencies {
// implementation(kotlin("test"))
}
}
val androidMain by getting {
dependencies {
with(Ktor){
implementation(ktorClientAndroid)
implementation(ktorClientOkhttp)
}
// api(MokoResources.androidMainApi1)
// implementation(SQLDelight.androidDriver)
}
}
val androidTest by getting
val iosX64Main by getting
val iosArm64Main by getting
val iosMain by creating {
dependsOn(commonMain)
iosX64Main.dependsOn(this)
iosArm64Main.dependsOn(this)
}
val iosX64Test by getting
val iosArm64Test by getting
val iosTest by creating {
dependsOn(commonTest)
iosX64Test.dependsOn(this)
iosArm64Test.dependsOn(this)
}
}
}
sqldelight {
database(Database.databaseName) {
packageName = Database.databasePackageName
sourceFolders = listOf(Database.databaseSourceFolder)
}
}
android {
namespace = Application.namespace_
compileSdk = Application.compileSdk
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
defaultConfig {
minSdk = Application.minSdk
targetSdk = Application.targetSdk
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
dependencies {
with(Moko){
commonMainApi(moko)
commonMainApi(serializationJson)
}
}
cocoaPods {
podsProject = file("../ios-app/Pods/Pods.xcodeproj") // here should be path to Pods xcode project
pod("mokoSocketIo", onlyLink = true)
}
Podfile:
target 'iosApp' do
use_frameworks!
platform :ios, '14.1'
pod 'shared', :path => '../shared'
pod 'mokoSocketIo', :git => 'https://github.com/icerockdev/moko-socket-io.git', :tag => 'release/0.3.0'
end
here is my socket class that contains the socket codes:
class Socket {
val socket = Socket(
endpoint = "https://socketio-chat-h9jt.herokuapp.com",
config = SocketOptions(
queryParams = null,
transport = SocketOptions.Transport.WEBSOCKET
)
) {
on(SocketEvent.Connect) {
println("connect")
}
on(SocketEvent.Connecting) {
println("connecting")
}
on(SocketEvent.Disconnect) {
println("disconnect")
}
on(SocketEvent.Error) {
println("error $it")
}
on(SocketEvent.Reconnect) {
println("reconnect")
}
on(SocketEvent.ReconnectAttempt) {
println("reconnect attempt $it")
}
on(SocketEvent.Ping) {
println("ping")
}
on(SocketEvent.Pong) {
println("pong")
}
listOf(
"input",
"login",
"new message",
"user joined",
"user left",
"typing",
"stop typing"
).forEach { eventName ->
on(eventName) { data ->
println("$eventName $data")
}
}
}
fun login() {
socket.emit("add user", "mokoSocketIo")
}
}
here I used the socket class in MainActivity and I want to log the socket connected state but I get false in any run
Socket().apply {
socket.connect()
login()
Log.e("ooo", "${socket.isConnected()}")
}

Unresolved reference: squareup in iosMain directory after adding dependencies

I am trying to use SQLDelight in a Kotlin Multiplatform project for android and iOS. I have followed the documentation found here. The project builds successfully, but I can't access com.squareup.* anywhere inside the shared/iosMain folder. Below are my code files.
Project/build.gradle.kts:
buildscript {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31")
classpath("com.android.tools.build:gradle:7.0.3")
classpath("com.squareup.sqldelight:gradle-plugin:1.5.2")
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
}
Project/shared/build.gradle.kts:
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
plugins {
kotlin("multiplatform")
kotlin("native.cocoapods")
id("com.android.library")
id("com.squareup.sqldelight")
}
version = "1.0"
kotlin {
android()
val iosTarget: (String, KotlinNativeTarget.() -> Unit) -> KotlinNativeTarget = when {
System.getenv("SDK_NAME")?.startsWith("iphoneos") == true -> ::iosArm64
System.getenv("NATIVE_ARCH")?.startsWith("arm") == true -> ::iosSimulatorArm64
else -> ::iosX64
}
iosTarget("ios") {}
cocoapods {
summary = "Some description for the Shared Module"
homepage = "Link to the Shared Module homepage"
ios.deploymentTarget = "14.1"
frameworkName = "shared"
podfile = project.file("../iosApp/Podfile")
}
sourceSets {
val commonMain by getting {
dependencies {
// SQLDelight
implementation("com.squareup.sqldelight:runtime:1.5.2")
implementation ("com.squareup.sqldelight:coroutines-extensions:1.5.0")
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
}
}
val androidMain by getting {
dependencies {
implementation("com.squareup.sqldelight:android-driver:1.5.0")
}
}
val androidTest by getting {
dependencies {
implementation(kotlin("test-junit"))
implementation("junit:junit:4.13.2")
}
}
val iosMain by getting {
dependencies {
implementation("com.squareup.sqldelight:native-driver:1.5.2")
}
}
val iosTest by getting
}
}
sqldelight {
database("AppDatabase") {
packageName = "com.example.sam.data.db"
dialect = "sqlite:3.25"
}
}
android {
compileSdkVersion(31)
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
defaultConfig {
minSdkVersion(21)
targetSdkVersion(31)
}
}
Project/shared/src/commonMain/kotlin/com/example/sam/data/db/DatabaseDriverFactory.kt
package com.example.sam.data.db
import com.squareup.sqldelight.db.SqlDriver
expect class DatabaseDriverFactory {
fun createDriver(): SqlDriver
}
Project/shared/src/androidMain/kotlin/com/example/sam/data/db/DatabaseDriverFactory.kt
package com.example.sam.data.db
import android.content.Context
import com.squareup.sqldelight.android.AndroidSqliteDriver
import com.squareup.sqldelight.db.SqlDriver
actual class DatabaseDriverFactory(
private val ctx: Context
) {
actual fun createDriver(): SqlDriver {
return AndroidSqliteDriver(AppDatabase.Schema, ctx, "app.db")
}
}
And the file that I am having issues with - Project/shared/iosMain/kotlin/com/example/sam/data/db/DatabaseDriverFactory.kt
package com.example.sam.data.db
import com.squareup.sqldelight.db.SqlDriver
import com.squareup.sqldelight.drivers.native.NativeSqliteDriver
actual class DatabaseDriverFactory {
actual fun createDriver(): SqlDriver {
return NativeSqliteDriver(AppDatabase.Schema, "app.db")
}
}
It can't find SqlDriver, NativeSqliteDriver or even com.squareup.*.
I have scoured the web, but didn't find anything that helped.
Comments won't let me post code, but I'd like to try some things.
Try this config and see if the IDE can understand it better. You'll still need to add back some form of the more complex one, but I'd like to reduce the variables as much as possible.
kotlin {
android()
iosX64("ios")
cocoapods {
//etc...

How do I add a watchOS target to my existing KMM project?

I have a project that I made using KMM plugin on android studio for Android and iOS. The project seems to be running fine.
Now I want to add a watchOS target to the existing ios App and have no clue how to go about this.
My shared build.gradle.kts file
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
plugins {
kotlin("multiplatform")
kotlin("plugin.serialization")
id("com.android.library")
id("com.squareup.sqldelight")
}
android {
compileSdkVersion(30)
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
defaultConfig {
minSdkVersion(21)
targetSdkVersion(30)
}
configurations {
create("androidTestApi")
create("androidTestDebugApi")
create("androidTestReleaseApi")
create("testApi")
create("testDebugApi")
create("testReleaseApi")
}
}
kotlin {
android()
val iosTarget: (String, KotlinNativeTarget.() -> Unit) -> KotlinNativeTarget =
if (System.getenv("SDK_NAME")?.startsWith("iphoneos") == true)
::iosArm64
else
::iosX64
iosTarget("ios") {
binaries {
framework {
baseName = "shared"
}
}
}
val ktorVersion = "1.4.1"
val serializationVersion = "1.0.0-RC"
val sqlDelightVersion: String by project
val coroutinesVersion = "1.3.9-native-mt"
sourceSets {
val commonMain by getting {
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
implementation("io.ktor:ktor-client-core:$ktorVersion")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:$serializationVersion")
implementation("io.ktor:ktor-client-serialization:$ktorVersion")
implementation("com.squareup.sqldelight:runtime:$sqlDelightVersion")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.1.0")
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
}
}
val androidMain by getting {
dependencies {
implementation("io.ktor:ktor-client-android:$ktorVersion")
implementation("com.squareup.sqldelight:android-driver:$sqlDelightVersion")
}
}
val androidTest by getting {
dependencies {
implementation(kotlin("test-junit"))
implementation("junit:junit:4.13.2")
}
}
val iosMain by getting {
dependencies {
implementation("io.ktor:ktor-client-ios:$ktorVersion")
implementation("com.squareup.sqldelight:native-driver:$sqlDelightVersion")
}
}
val iosTest by getting
}
}
sqldelight {
database("AppDatabase") {
packageName = "com.elixer.paws.shared.cache"
}
}
val packForXcode by tasks.creating(Sync::class) {
val mode = System.getenv("CONFIGURATION") ?: "DEBUG"
val framework = kotlin.targets.getByName<KotlinNativeTarget>("ios").binaries.getFramework(mode)
val targetDir = File(buildDir, "xcode-frameworks")
group = "build"
dependsOn(framework.linkTask)
inputs.property("mode", mode)
from({ framework.outputDirectory })
into(targetDir)
}
tasks.getByName("build").dependsOn(packForXcode)
Up until now, I just tried to open the ios app in Xcode and creating a new "watchOS" target. This sets up the watch OS app and I am able to share code between the iOS and watchOS but unable to "import shared" and all common files into watch OS.
I get this error when I try to run the project on watchOs
Building for watchOS Simulator, but the linked framework
'shared.framework' was built for iOS Simulator. kotlin project
Thanks for any help. I am not very good with gradle or ios dev. Anything will help at this point.
You need to add a watchOS target in your build.gradle.kts similarly how the iOS target is specified:
iosTarget("ios") {
...
}
watchos()
Also, if you'd like to share some of the implementation in your multiplatform code between the apple targets you may want to use dependsOn, for more information:
Documentation
Example

Publish Kotlin MultiPlatform Library Bintray Use Kotlin DSL

I wrote a library with Kotlin MultiPlatform (link)
I can add the library as a jar file to the project
But now I want to do this with bintray
I went ahead with the Link, but I had a problem
My problem was that the value of publicationName variable I was giving Gradle was wrong for me :
val publicationName = "MySharedCode"
publishing {
publications.invoke {
publicationName(MavenPublication::class) {
artifactId = artifactID
artifact(shadowJar)
pom.addDependencies()
}
}
}
Gradle Sync Error : Publication with name 'MySharedCode' not found.
My Kotlin Gradle DSL File :
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import com.jfrog.bintray.gradle.BintrayExtension
import org.gradle.api.publish.maven.MavenPom
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("multiplatform")
`maven-publish`
id("com.jfrog.bintray") version "1.8.4"
id ("com.github.johnrengelman.shadow") version "5.2.0"
java
}
val ktorVersion = "1.3.0-rc2"
val serialization = "0.11.0"
val coroutines = "1.2.1"
project.group = "com.my.domain"
project.version = "0.0.3"
val artifactID = "my-shared-lib"
kotlin {
//select iOS target platform depending on the Xcode environment variables
val iOSTarget: (String, KotlinNativeTarget.() -> Unit) -> KotlinNativeTarget =
if (System.getenv("SDK_NAME")?.startsWith("iphoneos") == true)
::iosArm64
else
::iosX64
iOSTarget("ios") {
binaries {
framework {
baseName = "MySharedCode"
}
}
}
jvm("android")
sourceSets["commonMain"].dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-common")
// HTTP
implementation("io.ktor:ktor-client-core:$ktorVersion")
implementation("io.ktor:ktor-client-json:$ktorVersion")
implementation("io.ktor:ktor-client-serialization:$ktorVersion")
// Coroutines
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-common:$coroutines")
}
sourceSets["androidMain"].dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib")
// HTTP
implementation("io.ktor:ktor-client-android:$ktorVersion")
implementation("io.ktor:ktor-client-json-jvm:$ktorVersion")
implementation("io.ktor:ktor-client-serialization-jvm:$ktorVersion")
// Coroutines
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines")
}
sourceSets["iosMain"].dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib")
// HTTP
implementation("io.ktor:ktor-client-ios:$ktorVersion")
implementation("io.ktor:ktor-client-json-native:$ktorVersion")
implementation("io.ktor:ktor-client-serialization-iosx64:$ktorVersion")
// Coroutines
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-native:$coroutines")
}
}
val packForXcode by tasks.creating(Sync::class) {
group = "build"
val mode = System.getenv("CONFIGURATION") ?: "DEBUG"
val framework = kotlin.targets.getByName<KotlinNativeTarget>("ios").binaries.getFramework(mode)
inputs.property("mode", mode)
dependsOn(framework.linkTask)
val targetDir = File(buildDir, "xcode-frameworks")
from({ framework.outputDirectory })
into(targetDir)
doLast {
val gradlew = File(targetDir, "gradlew")
gradlew.writeText("#!/bin/bash\nexport 'JAVA_HOME=${System.getProperty("java.home")}'\ncd '${rootProject.rootDir}'\n./gradlew \$#\n")
gradlew.setExecutable(true)
}
}
tasks.getByName("build").dependsOn(packForXcode)
val shadowJar: ShadowJar by tasks
shadowJar.apply {
baseName = artifactID
classifier = null
}
fun MavenPom.addDependencies() = withXml {
asNode().appendNode("dependencies").let { depNode ->
configurations.commonMainImplementation.allDependencies.forEach {
depNode.appendNode("dependency").apply {
appendNode("groupId", it.group)
appendNode("artifactId", it.name)
appendNode("version", it.version)
}
}
}
}
val publicationName = "MySharedCode"
publishing {
publications.invoke {
publicationName(MavenPublication::class) {
artifactId = artifactID
artifact(shadowJar)
pom.addDependencies()
}
}
}
fun findProperty(s: String) = project.findProperty(s) as String?
bintray {
user = "xxxx"
key = "xxxx"
publish = true
setPublications(publicationName)
pkg(delegateClosureOf<BintrayExtension.PackageConfig> {
repo = "lib"
name = "my repo name"
userOrg = "my user org"
websiteUrl = "https://my-domain.com/"
githubRepo = "myRepo"
vcsUrl = "myRepo url"
description = "my repo description"
setLabels("kotlin")
setLicenses("MIT")
desc = description
})
}
tasks {
withType(GradleBuild::class.java) {
dependsOn(shadowJar)
}
withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
withType(Test::class.java) {
testLogging.showStandardStreams = true
}
withType<GenerateMavenPom> {
destination = file("$buildDir/libs/${shadowJar.name}.pom")
}
}
You should create a gradle script for publishing mechanism by bintray and apply that into build.gradle.kts of MMP project scope.
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
plugins {
id("com.android.library")
id("org.jetbrains.kotlin.multiplatform")
}
apply(from = rootProject.file("publishSystem/publish.gradle"))
//
//
//
//
In the following put that it publishLibraryVariants in android extension into kotlin extension
kotlin {
android { publishLibraryVariants("release") }
//
//
//
//
}
This my first time seeing the "bintray" in Kotlin DSL.
But as per their documentation
bintray {
user = "xxxx"
key = "xxxx"
publish = true
publications = [publicationName] // this is an array
pkg {
repo = "lib"
name = "my repo name"
vcsUrl = "myRepo url"
licenses = ["MIT"]
version {
name = "1.0.0"
desc = "Release one Woraay ^_^"
released = new Date()
}
}
}
Personally, I'm using something else on my end. Why don't you try this one out?
publishing {
repositories.maven("https://api.bintray.com/maven/THE REST OF THE URL;publish=1") {
name = "bintray"
credentials {
username = "ADMIN"
password = "ADMIN"
}
}
publications {
register("plugin", MavenPublication::class) {
groupId = "com.example.MySharedCode"
artifactId = "MySharedCode"
version = "1.0.0"
from(components["java"])
}
}
}
gradlePlugin {
plugins {
create("Gradle-Plugin") {
this.id = "com.example.MySharedCode"
this.implementationClass = "com.example.MySharedCode.gradle.MainClassNameHere"
}
}
}

Categories

Resources