Merge pull request #2 from InsanusMokrassar/rewrite_on_multiplatform
rewrite on multiplatform
16
.github/workflows/build.yml
vendored
@ -1,16 +0,0 @@
|
|||||||
name: Build
|
|
||||||
|
|
||||||
on: [push]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: Set up JDK 11
|
|
||||||
uses: actions/setup-java@v1
|
|
||||||
with:
|
|
||||||
java-version: 11
|
|
||||||
- name: Build with Gradle
|
|
||||||
run: ./gradlew build
|
|
8
.github/workflows/commit-release.yml
vendored
@ -13,8 +13,12 @@ jobs:
|
|||||||
uses: actions/setup-java@v1
|
uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
java-version: 11
|
java-version: 11
|
||||||
|
- name: Set version from gradle.properties
|
||||||
|
run: echo "version=` cat gradle.properties | grep ^version= | grep -o [\\.0-9]* `" >> $GITHUB_ENV
|
||||||
- name: Build
|
- name: Build
|
||||||
run: ./gradlew packageUberJarForCurrentOS
|
run: ./gradlew packageUberJarForCurrentOS
|
||||||
|
env:
|
||||||
|
additional_version: ""
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
id: create_release
|
id: create_release
|
||||||
uses: actions/create-release@v1
|
uses: actions/create-release@v1
|
||||||
@ -22,7 +26,7 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
|
||||||
with:
|
with:
|
||||||
tag_name: build-${{ github.sha }}
|
tag_name: build-${{ github.sha }}
|
||||||
release_name: Commit ${{ github.sha }}
|
release_name: "Build #${{ github.run_number }}"
|
||||||
body: It is just temporal release for ${{ github.sha }} commit
|
body: It is just temporal release for ${{ github.sha }} commit
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: true
|
prerelease: true
|
||||||
@ -33,6 +37,6 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
|
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
|
||||||
asset_path: ./build/compose/jars/KotlinPublicationScriptsBuilder-linux-x64.jar
|
asset_path: "./desktop/build/compose/jars/kmppscriptbuilder.desktop-linux-x64-${{ env.version }}${{ env.additional_version }}.jar"
|
||||||
asset_name: KotlinPublicationScriptsBuilder-linux-x64.jar
|
asset_name: KotlinPublicationScriptsBuilder-linux-x64.jar
|
||||||
asset_content_type: application/java-archive
|
asset_content_type: application/java-archive
|
||||||
|
2
.gitignore
vendored
@ -8,3 +8,5 @@ settings.xml
|
|||||||
.gradle/
|
.gradle/
|
||||||
build/
|
build/
|
||||||
out/
|
out/
|
||||||
|
|
||||||
|
local.properties
|
||||||
|
68
build.gradle
@ -1,53 +1,31 @@
|
|||||||
buildscript {
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
jcenter()
|
||||||
|
google()
|
||||||
|
mavenCentral()
|
||||||
|
mavenLocal()
|
||||||
|
maven { url "https://plugins.gradle.org/m2/" }
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
classpath 'com.android.tools.build:gradle:4.0.2'
|
||||||
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
|
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
|
||||||
|
classpath "com.getkeepsafe.dexcount:dexcount-gradle-plugin:$dexcount_version"
|
||||||
|
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
jcenter()
|
jcenter()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
google()
|
||||||
|
maven { url "https://kotlin.bintray.com/kotlinx" }
|
||||||
dependencies {
|
maven { url "https://maven.pkg.jetbrains.space/public/p/compose/dev" }
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
||||||
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
plugins {
|
apply from: "./extensions.gradle"
|
||||||
id "org.jetbrains.kotlin.plugin.serialization" version "$kotlin_version"
|
// apply from: "./github_release.gradle"
|
||||||
id("org.jetbrains.compose") version "$compose_version"
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: 'kotlin'
|
|
||||||
|
|
||||||
project.group = "com.insanusmokrassar"
|
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
jcenter()
|
|
||||||
mavenCentral()
|
|
||||||
maven { url "https://kotlin.bintray.com/kotlinx" }
|
|
||||||
maven { url "https://maven.pkg.jetbrains.space/public/p/compose/dev" }
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
||||||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version"
|
|
||||||
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlin_serialisation_runtime_version"
|
|
||||||
implementation "dev.inmo:micro_utils.coroutines:$micro_utils_version"
|
|
||||||
implementation(compose.desktop.currentOs)
|
|
||||||
|
|
||||||
implementation "io.ktor:ktor-client:$ktor_version"
|
|
||||||
implementation "io.ktor:ktor-client-cio:$ktor_version"
|
|
||||||
}
|
|
||||||
|
|
||||||
compose.desktop {
|
|
||||||
application {
|
|
||||||
mainClass = "com.insanusmokrassar.kmppscriptbuilder.BuilderKt"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
compileKotlin {
|
|
||||||
kotlinOptions {
|
|
||||||
jvmTarget = "11"
|
|
||||||
useIR = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
20
core/build.gradle
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
plugins {
|
||||||
|
id "org.jetbrains.kotlin.multiplatform"
|
||||||
|
id "org.jetbrains.kotlin.plugin.serialization"
|
||||||
|
id "com.android.library"
|
||||||
|
}
|
||||||
|
|
||||||
|
apply from: "$mppProjectWithSerializationPresetPath"
|
||||||
|
|
||||||
|
kotlin {
|
||||||
|
sourceSets {
|
||||||
|
commonMain {
|
||||||
|
dependencies {
|
||||||
|
api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version"
|
||||||
|
api "dev.inmo:micro_utils.coroutines:$micro_utils_version"
|
||||||
|
|
||||||
|
api "io.ktor:ktor-client-core:$ktor_version"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
package com.insanusmokrassar.kmppscriptbuilder.export.jvm_only
|
package dev.inmo.kmppscriptbuilder.core.export.jvm_only
|
||||||
|
|
||||||
import com.insanusmokrassar.kmppscriptbuilder.models.*
|
import dev.inmo.kmppscriptbuilder.core.models.*
|
||||||
|
|
||||||
fun MavenConfig.buildJvmOnlyMavenConfig(licenses: List<License>): String = """
|
fun MavenConfig.buildJvmOnlyMavenConfig(licenses: List<License>): String = """
|
||||||
apply plugin: 'maven-publish'
|
apply plugin: 'maven-publish'
|
@ -1,6 +1,6 @@
|
|||||||
package com.insanusmokrassar.kmppscriptbuilder.export.mpp
|
package dev.inmo.kmppscriptbuilder.core.export.mpp
|
||||||
|
|
||||||
import com.insanusmokrassar.kmppscriptbuilder.models.*
|
import dev.inmo.kmppscriptbuilder.core.models.*
|
||||||
|
|
||||||
fun MavenConfig.buildMultiplatformMavenConfig(licenses: List<License>): String = """
|
fun MavenConfig.buildMultiplatformMavenConfig(licenses: List<License>): String = """
|
||||||
apply plugin: 'maven-publish'
|
apply plugin: 'maven-publish'
|
@ -1,7 +1,7 @@
|
|||||||
package com.insanusmokrassar.kmppscriptbuilder.models
|
package dev.inmo.kmppscriptbuilder.core.models
|
||||||
|
|
||||||
import com.insanusmokrassar.kmppscriptbuilder.export.jvm_only.buildJvmOnlyMavenConfig
|
import dev.inmo.kmppscriptbuilder.core.export.jvm_only.buildJvmOnlyMavenConfig
|
||||||
import com.insanusmokrassar.kmppscriptbuilder.export.mpp.buildMultiplatformMavenConfig
|
import dev.inmo.kmppscriptbuilder.core.export.mpp.buildMultiplatformMavenConfig
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.*
|
||||||
import kotlinx.serialization.builtins.serializer
|
import kotlinx.serialization.builtins.serializer
|
||||||
import kotlinx.serialization.descriptors.SerialDescriptor
|
import kotlinx.serialization.descriptors.SerialDescriptor
|
||||||
@ -16,7 +16,7 @@ sealed class ProjectType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Serializer(ProjectType::class)
|
@Serializer(ProjectType::class)
|
||||||
internal object ProjectTypeSerializer : KSerializer<ProjectType> {
|
object ProjectTypeSerializer : KSerializer<ProjectType> {
|
||||||
override val descriptor: SerialDescriptor = String.serializer().descriptor
|
override val descriptor: SerialDescriptor = String.serializer().descriptor
|
||||||
override fun deserialize(decoder: Decoder): ProjectType {
|
override fun deserialize(decoder: Decoder): ProjectType {
|
||||||
return when (decoder.decodeString()) {
|
return when (decoder.decodeString()) {
|
@ -1,4 +1,4 @@
|
|||||||
package com.insanusmokrassar.kmppscriptbuilder.models
|
package dev.inmo.kmppscriptbuilder.core.models
|
||||||
|
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
package com.insanusmokrassar.kmppscriptbuilder.models
|
package dev.inmo.kmppscriptbuilder.core.models
|
||||||
|
|
||||||
import com.insanusmokrassar.kmppscriptbuilder.utils.serialFormat
|
import dev.inmo.kmppscriptbuilder.core.utils.serialFormat
|
||||||
import io.ktor.client.HttpClient
|
import io.ktor.client.HttpClient
|
||||||
import io.ktor.client.request.get
|
import io.ktor.client.request.get
|
||||||
import io.ktor.client.request.url
|
import io.ktor.client.request.url
|
@ -1,4 +1,4 @@
|
|||||||
package com.insanusmokrassar.kmppscriptbuilder.models
|
package dev.inmo.kmppscriptbuilder.core.models
|
||||||
|
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package com.insanusmokrassar.kmppscriptbuilder.utils
|
package dev.inmo.kmppscriptbuilder.core.utils
|
||||||
|
|
||||||
import kotlinx.serialization.json.Json
|
import kotlinx.serialization.json.Json
|
||||||
|
|
1
core/src/main/AndroidManifest.xml
Normal file
@ -0,0 +1 @@
|
|||||||
|
<manifest package="dev.inmo.KotlinPublicationScriptsBuilder.core"/>
|
40
defaultAndroidSettings.gradle
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
apply plugin: 'com.getkeepsafe.dexcount'
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdkVersion "$android_compileSdkVersion".toInteger()
|
||||||
|
buildToolsVersion "$android_buildToolsVersion"
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
minSdkVersion "$android_minSdkVersion".toInteger()
|
||||||
|
targetSdkVersion "$android_compileSdkVersion".toInteger()
|
||||||
|
versionCode "${android_code_version}".toInteger()
|
||||||
|
versionName "$version"
|
||||||
|
}
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
minifyEnabled false
|
||||||
|
}
|
||||||
|
debug {
|
||||||
|
debuggable true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
packagingOptions {
|
||||||
|
exclude 'META-INF/kotlinx-serialization-runtime.kotlin_module'
|
||||||
|
exclude 'META-INF/kotlinx-serialization-cbor.kotlin_module'
|
||||||
|
exclude 'META-INF/kotlinx-serialization-properties.kotlin_module'
|
||||||
|
}
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
|
}
|
||||||
|
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = JavaVersion.VERSION_1_8.toString()
|
||||||
|
}
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
main.java.srcDirs += 'src/main/kotlin'
|
||||||
|
}
|
||||||
|
}
|
37
desktop/build.gradle
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
plugins {
|
||||||
|
id "org.jetbrains.kotlin.multiplatform"
|
||||||
|
id "org.jetbrains.kotlin.plugin.serialization"
|
||||||
|
id("org.jetbrains.compose") version "$compose_version"
|
||||||
|
}
|
||||||
|
|
||||||
|
apply from: "$mppJavaProjectPresetPath"
|
||||||
|
|
||||||
|
kotlin {
|
||||||
|
jvm {
|
||||||
|
compilations.main.kotlinOptions {
|
||||||
|
jvmTarget = "11"
|
||||||
|
useIR = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sourceSets {
|
||||||
|
commonMain {
|
||||||
|
dependencies {
|
||||||
|
implementation project(":kmppscriptbuilder.core")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
jvmMain {
|
||||||
|
dependencies {
|
||||||
|
implementation(compose.desktop.currentOs)
|
||||||
|
api "io.ktor:ktor-client-cio:$ktor_version"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
compose.desktop {
|
||||||
|
application {
|
||||||
|
mainClass = "dev.inmo.kmppscriptbuilder.desktop.BuilderKt"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package com.insanusmokrassar.kmppscriptbuilder
|
package dev.inmo.kmppscriptbuilder.desktop
|
||||||
|
|
||||||
import androidx.compose.desktop.Window
|
import androidx.compose.desktop.Window
|
||||||
import androidx.compose.foundation.*
|
import androidx.compose.foundation.*
|
||||||
@ -7,8 +7,8 @@ import androidx.compose.material.*
|
|||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import com.insanusmokrassar.kmppscriptbuilder.utils.*
|
import dev.inmo.kmppscriptbuilder.desktop.utils.*
|
||||||
import com.insanusmokrassar.kmppscriptbuilder.views.*
|
import dev.inmo.kmppscriptbuilder.desktop.views.*
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
//private val uncaughtExceptionsBC = BroadcastChannel<DefaultErrorHandler.ErrorEvent>(Channel.CONFLATED)
|
//private val uncaughtExceptionsBC = BroadcastChannel<DefaultErrorHandler.ErrorEvent>(Channel.CONFLATED)
|
@ -1,6 +1,7 @@
|
|||||||
package com.insanusmokrassar.kmppscriptbuilder.utils
|
package dev.inmo.kmppscriptbuilder.desktop.utils
|
||||||
|
|
||||||
import com.insanusmokrassar.kmppscriptbuilder.models.Config
|
import dev.inmo.kmppscriptbuilder.core.models.Config
|
||||||
|
import dev.inmo.kmppscriptbuilder.core.utils.serialFormat
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import javax.swing.JFileChooser
|
import javax.swing.JFileChooser
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package com.insanusmokrassar.kmppscriptbuilder.utils
|
package dev.inmo.kmppscriptbuilder.desktop.utils
|
||||||
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import javax.swing.filechooser.FileFilter
|
import javax.swing.filechooser.FileFilter
|
@ -1,4 +1,4 @@
|
|||||||
package com.insanusmokrassar.kmppscriptbuilder.utils
|
package dev.inmo.kmppscriptbuilder.desktop.utils
|
||||||
|
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
import androidx.compose.foundation.layout.*
|
import androidx.compose.foundation.layout.*
|
@ -1,4 +1,4 @@
|
|||||||
package com.insanusmokrassar.kmppscriptbuilder.utils
|
package dev.inmo.kmppscriptbuilder.desktop.utils
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.*
|
import androidx.compose.foundation.layout.*
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
@ -1,4 +1,4 @@
|
|||||||
package com.insanusmokrassar.kmppscriptbuilder.views
|
package dev.inmo.kmppscriptbuilder.desktop.views
|
||||||
|
|
||||||
import androidx.compose.foundation.Image
|
import androidx.compose.foundation.Image
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
@ -8,8 +8,8 @@ import androidx.compose.runtime.*
|
|||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.res.svgResource
|
import androidx.compose.ui.res.svgResource
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.insanusmokrassar.kmppscriptbuilder.models.Config
|
import dev.inmo.kmppscriptbuilder.core.models.Config
|
||||||
import com.insanusmokrassar.kmppscriptbuilder.utils.*
|
import dev.inmo.kmppscriptbuilder.desktop.utils.*
|
||||||
|
|
||||||
class BuilderView : View() {
|
class BuilderView : View() {
|
||||||
private val projectTypeView = ProjectTypeView()
|
private val projectTypeView = ProjectTypeView()
|
@ -1,8 +1,8 @@
|
|||||||
package com.insanusmokrassar.kmppscriptbuilder.views
|
package dev.inmo.kmppscriptbuilder.desktop.views
|
||||||
|
|
||||||
import androidx.compose.runtime.*
|
import androidx.compose.runtime.*
|
||||||
import com.insanusmokrassar.kmppscriptbuilder.models.Developer
|
import dev.inmo.kmppscriptbuilder.core.models.Developer
|
||||||
import com.insanusmokrassar.kmppscriptbuilder.utils.*
|
import dev.inmo.kmppscriptbuilder.desktop.utils.*
|
||||||
|
|
||||||
class DeveloperState(
|
class DeveloperState(
|
||||||
id: String = "",
|
id: String = "",
|
@ -1,4 +1,4 @@
|
|||||||
package com.insanusmokrassar.kmppscriptbuilder.views
|
package dev.inmo.kmppscriptbuilder.desktop.views
|
||||||
|
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
import androidx.compose.foundation.layout.*
|
import androidx.compose.foundation.layout.*
|
||||||
@ -7,9 +7,9 @@ import androidx.compose.material.Divider
|
|||||||
import androidx.compose.runtime.*
|
import androidx.compose.runtime.*
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.insanusmokrassar.kmppscriptbuilder.models.License
|
import dev.inmo.kmppscriptbuilder.core.models.License
|
||||||
import com.insanusmokrassar.kmppscriptbuilder.models.getLicenses
|
import dev.inmo.kmppscriptbuilder.core.models.getLicenses
|
||||||
import com.insanusmokrassar.kmppscriptbuilder.utils.*
|
import dev.inmo.kmppscriptbuilder.desktop.utils.*
|
||||||
import io.ktor.client.HttpClient
|
import io.ktor.client.HttpClient
|
||||||
import kotlinx.coroutines.*
|
import kotlinx.coroutines.*
|
||||||
|
|
@ -1,12 +1,11 @@
|
|||||||
package com.insanusmokrassar.kmppscriptbuilder.views
|
package dev.inmo.kmppscriptbuilder.desktop.views
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.*
|
import androidx.compose.foundation.layout.*
|
||||||
import androidx.compose.material.*
|
import androidx.compose.material.*
|
||||||
import androidx.compose.runtime.*
|
import androidx.compose.runtime.*
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.insanusmokrassar.kmppscriptbuilder.models.Developer
|
import dev.inmo.kmppscriptbuilder.desktop.utils.*
|
||||||
import com.insanusmokrassar.kmppscriptbuilder.utils.*
|
|
||||||
|
|
||||||
abstract class ListView<T>(title: String) : VerticalView(title) {
|
abstract class ListView<T>(title: String) : VerticalView(title) {
|
||||||
protected val itemsList = mutableStateListOf<T>()
|
protected val itemsList = mutableStateListOf<T>()
|
@ -1,10 +1,10 @@
|
|||||||
package com.insanusmokrassar.kmppscriptbuilder.views
|
package dev.inmo.kmppscriptbuilder.desktop.views
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.ColumnScope
|
import androidx.compose.foundation.layout.ColumnScope
|
||||||
import androidx.compose.runtime.*
|
import androidx.compose.runtime.*
|
||||||
import com.insanusmokrassar.kmppscriptbuilder.models.MavenConfig
|
import dev.inmo.kmppscriptbuilder.core.models.MavenConfig
|
||||||
import com.insanusmokrassar.kmppscriptbuilder.models.SonatypeRepository
|
import dev.inmo.kmppscriptbuilder.core.models.SonatypeRepository
|
||||||
import com.insanusmokrassar.kmppscriptbuilder.utils.*
|
import dev.inmo.kmppscriptbuilder.desktop.utils.*
|
||||||
|
|
||||||
class MavenInfoView : VerticalView("Project information") {
|
class MavenInfoView : VerticalView("Project information") {
|
||||||
private var projectNameProperty by mutableStateOf("")
|
private var projectNameProperty by mutableStateOf("")
|
@ -1,4 +1,4 @@
|
|||||||
package com.insanusmokrassar.kmppscriptbuilder.views
|
package dev.inmo.kmppscriptbuilder.desktop.views
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.*
|
import androidx.compose.foundation.layout.*
|
||||||
import androidx.compose.material.Switch
|
import androidx.compose.material.Switch
|
||||||
@ -6,8 +6,8 @@ import androidx.compose.material.Text
|
|||||||
import androidx.compose.runtime.*
|
import androidx.compose.runtime.*
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.insanusmokrassar.kmppscriptbuilder.models.*
|
import dev.inmo.kmppscriptbuilder.core.models.*
|
||||||
import com.insanusmokrassar.kmppscriptbuilder.utils.VerticalView
|
import dev.inmo.kmppscriptbuilder.desktop.utils.VerticalView
|
||||||
|
|
||||||
class ProjectTypeView : VerticalView("Project type") {
|
class ProjectTypeView : VerticalView("Project type") {
|
||||||
private var projectTypeState by mutableStateOf<Boolean>(false)
|
private var projectTypeState by mutableStateOf<Boolean>(false)
|
@ -1,8 +1,8 @@
|
|||||||
package com.insanusmokrassar.kmppscriptbuilder.views
|
package dev.inmo.kmppscriptbuilder.desktop.views
|
||||||
|
|
||||||
import androidx.compose.runtime.*
|
import androidx.compose.runtime.*
|
||||||
import com.insanusmokrassar.kmppscriptbuilder.models.MavenPublishingRepository
|
import dev.inmo.kmppscriptbuilder.core.models.MavenPublishingRepository
|
||||||
import com.insanusmokrassar.kmppscriptbuilder.utils.*
|
import dev.inmo.kmppscriptbuilder.desktop.utils.*
|
||||||
|
|
||||||
class RepositoryState(
|
class RepositoryState(
|
||||||
name: String = "",
|
name: String = "",
|
Before Width: | Height: | Size: 463 B After Width: | Height: | Size: 463 B |
Before Width: | Height: | Size: 452 B After Width: | Height: | Size: 452 B |
Before Width: | Height: | Size: 744 B After Width: | Height: | Size: 744 B |
Before Width: | Height: | Size: 502 B After Width: | Height: | Size: 502 B |
24
extensions.gradle
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
allprojects {
|
||||||
|
ext {
|
||||||
|
projectByName = { String name ->
|
||||||
|
for (subproject in rootProject.subprojects) {
|
||||||
|
if (subproject.name == name) {
|
||||||
|
return subproject
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
internalProject = { String name ->
|
||||||
|
projectByName(name)
|
||||||
|
}
|
||||||
|
|
||||||
|
mppProjectWithSerializationPresetPath = "${rootProject.projectDir.absolutePath}/mppProjectWithSerialization.gradle"
|
||||||
|
mppJavaProjectPresetPath = "${rootProject.projectDir.absolutePath}/mppJavaProject.gradle"
|
||||||
|
mppAndroidProjectPresetPath = "${rootProject.projectDir.absolutePath}/mppAndroidProject.gradle"
|
||||||
|
|
||||||
|
defaultAndroidSettingsPresetPath = "${rootProject.projectDir.absolutePath}/defaultAndroidSettings.gradle"
|
||||||
|
|
||||||
|
// publishGradlePath = "${rootProject.projectDir.absolutePath}/publish.gradle"
|
||||||
|
}
|
||||||
|
}
|
@ -1,10 +1,35 @@
|
|||||||
|
kotlin.code.style=official
|
||||||
|
org.gradle.parallel=true
|
||||||
|
kotlin.js.generate.externals=true
|
||||||
|
kotlin.incremental=true
|
||||||
|
kotlin.incremental.js=true
|
||||||
|
android.useAndroidX=true
|
||||||
|
android.enableJetifier=true
|
||||||
|
|
||||||
kotlin_version=1.4.30
|
kotlin_version=1.4.30
|
||||||
kotlin_coroutines_version=1.4.2
|
kotlin_coroutines_version=1.4.2
|
||||||
kotlin_serialisation_runtime_version=1.1.0
|
kotlin_serialisation_core_version=1.1.0
|
||||||
#tornadofx_version=1.7.20
|
|
||||||
ktor_version=1.5.1
|
ktor_version=1.5.1
|
||||||
micro_utils_version=0.4.25
|
micro_utils_version=0.4.27
|
||||||
|
|
||||||
javafxplugin_version=0.0.9
|
|
||||||
|
|
||||||
compose_version=0.3.0
|
compose_version=0.3.0
|
||||||
|
|
||||||
|
# ANDROID
|
||||||
|
|
||||||
|
android_minSdkVersion=21
|
||||||
|
android_compileSdkVersion=30
|
||||||
|
android_buildToolsVersion=30.0.2
|
||||||
|
dexcount_version=2.0.0
|
||||||
|
junit_version=4.12
|
||||||
|
test_ext_junit_version=1.1.2
|
||||||
|
espresso_core=3.3.0
|
||||||
|
|
||||||
|
# Dokka
|
||||||
|
|
||||||
|
dokka_version=1.4.20
|
||||||
|
|
||||||
|
# Project data
|
||||||
|
|
||||||
|
group=dev.inmo
|
||||||
|
version=0.0.1
|
||||||
|
android_code_version=1
|
||||||
|
26
mppAndroidProject.gradle
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
project.version = "$version" + System.getenv("additional_version")
|
||||||
|
project.group = "$group"
|
||||||
|
|
||||||
|
// apply from: "$publishGradlePath"
|
||||||
|
|
||||||
|
kotlin {
|
||||||
|
android {
|
||||||
|
publishAllLibraryVariants()
|
||||||
|
}
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
commonMain {
|
||||||
|
dependencies {
|
||||||
|
implementation kotlin('stdlib')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
commonTest {
|
||||||
|
dependencies {
|
||||||
|
implementation kotlin('test-common')
|
||||||
|
implementation kotlin('test-annotations-common')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
apply from: "$defaultAndroidSettingsPresetPath"
|
30
mppJavaProject.gradle
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
project.version = "$version" + System.getenv("additional_version")
|
||||||
|
project.group = "$group"
|
||||||
|
|
||||||
|
// apply from: "$publishGradlePath"
|
||||||
|
|
||||||
|
kotlin {
|
||||||
|
jvm {
|
||||||
|
compilations.main.kotlinOptions.useIR = true
|
||||||
|
}
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
commonMain {
|
||||||
|
dependencies {
|
||||||
|
implementation kotlin('stdlib')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
commonTest {
|
||||||
|
dependencies {
|
||||||
|
implementation kotlin('test-common')
|
||||||
|
implementation kotlin('test-annotations-common')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
jvmTest {
|
||||||
|
dependencies {
|
||||||
|
implementation kotlin('test-junit')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
52
mppProjectWithSerialization.gradle
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
project.version = "$version" + System.getenv("additional_version")
|
||||||
|
project.group = "$group"
|
||||||
|
|
||||||
|
// apply from: "$publishGradlePath"
|
||||||
|
|
||||||
|
kotlin {
|
||||||
|
jvm {
|
||||||
|
compilations.main.kotlinOptions.useIR = true
|
||||||
|
}
|
||||||
|
js (IR) {
|
||||||
|
browser()
|
||||||
|
nodejs()
|
||||||
|
}
|
||||||
|
android {
|
||||||
|
publishAllLibraryVariants()
|
||||||
|
}
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
commonMain {
|
||||||
|
dependencies {
|
||||||
|
implementation kotlin('stdlib')
|
||||||
|
api "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlin_serialisation_core_version"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
commonTest {
|
||||||
|
dependencies {
|
||||||
|
implementation kotlin('test-common')
|
||||||
|
implementation kotlin('test-annotations-common')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
jvmTest {
|
||||||
|
dependencies {
|
||||||
|
implementation kotlin('test-junit')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
jsTest {
|
||||||
|
dependencies {
|
||||||
|
implementation kotlin('test-js')
|
||||||
|
implementation kotlin('test-junit')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
androidTest {
|
||||||
|
dependencies {
|
||||||
|
implementation kotlin('test-junit')
|
||||||
|
implementation "androidx.test.ext:junit:$test_ext_junit_version"
|
||||||
|
implementation "androidx.test.espresso:espresso-core:$espresso_core"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
apply from: "$defaultAndroidSettingsPresetPath"
|
@ -5,4 +5,21 @@ pluginManagement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rootProject.name = 'KotlinPublicationScriptsBuilder'
|
rootProject.name = 'kmppscriptbuilder'
|
||||||
|
|
||||||
|
String[] includes = [
|
||||||
|
":core",
|
||||||
|
":desktop"
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
includes.each { originalName ->
|
||||||
|
String projectDirectory = "${rootProject.projectDir.getAbsolutePath()}${originalName.replaceAll(":", File.separator)}"
|
||||||
|
String projectName = "${rootProject.name}${originalName.replaceAll(":", ".")}"
|
||||||
|
String projectIdentifier = ":${projectName}"
|
||||||
|
include projectIdentifier
|
||||||
|
ProjectDescriptor project = project(projectIdentifier)
|
||||||
|
project.name = projectName
|
||||||
|
project.projectDir = new File(projectDirectory)
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
package com.insanusmokrassar.kmppscriptbuilder.models
|
|
||||||
|
|
||||||
import kotlinx.serialization.Serializable
|
|
||||||
|
|
||||||
@Serializable
|
|
||||||
data class BintrayConfig(
|
|
||||||
val repoUser: String = "\${project.hasProperty('BINTRAY_USER') ? project.property('BINTRAY_USER') : System.getenv('BINTRAY_USER')}",
|
|
||||||
val repo: String,
|
|
||||||
val packageName: String,
|
|
||||||
val packageVcs: String,
|
|
||||||
val autoPublish: Boolean = false,
|
|
||||||
val overridePublish: Boolean = false
|
|
||||||
)
|
|