Wizard: introduce Compose MPP template

This commit is contained in:
Ilya Kirillov
2020-10-09 21:35:59 +03:00
parent 7422690ea1
commit 1cc007fcbf
37 changed files with 783 additions and 66 deletions
@@ -0,0 +1,32 @@
plugins {
id 'org.jetbrains.compose' version '0.1.0-build63'
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}
group = 'me.user'
version = '1.0-SNAPSHOT'
repositories {
google()
}
dependencies {
implementation project(':common')
}
android {
compileSdkVersion 29
defaultConfig {
applicationId 'me.user.android'
minSdkVersion 24
targetSdkVersion 29
versionCode 1
versionName '1.0'
}
buildTypes {
'release' {
minifyEnabled false
}
}
}
@@ -0,0 +1,32 @@
plugins {
id("org.jetbrains.compose") version "0.1.0-build63"
id("com.android.application")
kotlin("android")
}
group = "me.user"
version = "1.0-SNAPSHOT"
repositories {
google()
}
dependencies {
implementation(project(":common"))
}
android {
compileSdkVersion(29)
defaultConfig {
applicationId = "me.user.android"
minSdkVersion(24)
targetSdkVersion(29)
versionCode = 1
versionName = "1.0"
}
buildTypes {
getByName("release") {
isMinifyEnabled = false
}
}
}
@@ -0,0 +1,24 @@
buildscript {
repositories {
gradlePluginPortal()
jcenter()
google()
maven { url 'KOTLIN_REPO' }
}
dependencies {
classpath('org.jetbrains.kotlin:kotlin-gradle-plugin:KOTLIN_VERSION')
classpath('com.android.tools.build:gradle:4.0.1')
}
}
group = 'me.user'
version = '1.0-SNAPSHOT'
allprojects {
repositories {
jcenter()
mavenCentral()
maven { url 'KOTLIN_REPO' }
maven { url 'https://maven.pkg.jetbrains.space/public/p/compose/dev' }
}
}
@@ -0,0 +1,24 @@
buildscript {
repositories {
gradlePluginPortal()
jcenter()
google()
maven { url = uri("KOTLIN_REPO") }
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:KOTLIN_VERSION")
classpath("com.android.tools.build:gradle:4.0.1")
}
}
group = "me.user"
version = "1.0-SNAPSHOT"
allprojects {
repositories {
jcenter()
mavenCentral()
maven { url = uri("KOTLIN_REPO") }
maven { url = uri("https://maven.pkg.jetbrains.space/public/p/compose/dev") }
}
}
@@ -0,0 +1,60 @@
import org.jetbrains.compose.compose
plugins {
id 'org.jetbrains.kotlin.multiplatform'
id 'org.jetbrains.compose' version '0.1.0-build63'
id 'com.android.library'
id 'kotlin-android-extensions'
}
group = 'me.user'
version = '1.0-SNAPSHOT'
repositories {
google()
}
kotlin {
android()
jvm('desktop') {
compilations.all {
kotlinOptions.jvmTarget = '1.8'
}
}
sourceSets {
commonMain {
dependencies {
api compose.runtime
api compose.foundation
api compose.material
}
}
commonTest {
}
androidMain {
dependencies {
api 'androidx.appcompat:appcompat:1.2.0'
api 'androidx.core:core-ktx:1.3.1'
}
}
androidTest {
}
desktopMain {
}
desktopTest {
}
}
}
android {
compileSdkVersion 29
sourceSets.main.manifest.srcFile('src/androidMain/AndroidManifest.xml')
defaultConfig {
minSdkVersion 24
targetSdkVersion 29
}
}
@@ -0,0 +1,52 @@
import org.jetbrains.compose.compose
plugins {
kotlin("multiplatform")
id("org.jetbrains.compose") version "0.1.0-build63"
id("com.android.library")
id("kotlin-android-extensions")
}
group = "me.user"
version = "1.0-SNAPSHOT"
repositories {
google()
}
kotlin {
android()
jvm("desktop") {
compilations.all {
kotlinOptions.jvmTarget = "1.8"
}
}
sourceSets {
val commonMain by getting {
dependencies {
api(compose.runtime)
api(compose.foundation)
api(compose.material)
}
}
val commonTest by getting
val androidMain by getting {
dependencies {
api("androidx.appcompat:appcompat:1.2.0")
api("androidx.core:core-ktx:1.3.1")
}
}
val androidTest by getting
val desktopMain by getting
val desktopTest by getting
}
}
android {
compileSdkVersion(29)
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
defaultConfig {
minSdkVersion(24)
targetSdkVersion(29)
}
}
@@ -0,0 +1,27 @@
import org.jetbrains.compose.compose
plugins {
id 'org.jetbrains.kotlin.jvm'
id 'org.jetbrains.compose' version '0.1.0-build63'
id 'application'
}
group = 'me.user'
version = '1.0-SNAPSHOT'
dependencies {
implementation project(':common')
implementation compose.desktop.all
}
compileKotlin {
kotlinOptions.jvmTarget = '1.8'
}
compileTestKotlin {
kotlinOptions.jvmTarget = '1.8'
}
application {
mainClassName = 'MainKt'
}
@@ -0,0 +1,24 @@
import org.jetbrains.compose.compose
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm")
id("org.jetbrains.compose") version "0.1.0-build63"
application
}
group = "me.user"
version = "1.0-SNAPSHOT"
dependencies {
implementation(project(":common"))
implementation(compose.desktop.all)
}
tasks.withType<KotlinCompile>() {
kotlinOptions.jvmTarget = "1.8"
}
application {
mainClassName = "MainKt"
}
@@ -0,0 +1,17 @@
pluginManagement {
repositories {
google()
jcenter()
gradlePluginPortal()
mavenCentral()
maven { url 'KOTLIN_REPO' }
maven { url 'https://maven.pkg.jetbrains.space/public/p/compose/dev' }
}
}
rootProject.name = 'composeMultiplatformApplication'
include(':android')
include(':desktop')
include(':common')
@@ -0,0 +1,17 @@
pluginManagement {
repositories {
google()
jcenter()
gradlePluginPortal()
mavenCentral()
maven { url = uri("KOTLIN_REPO") }
maven { url = uri("https://maven.pkg.jetbrains.space/public/p/compose/dev") }
}
}
rootProject.name = "composeMultiplatformApplication"
include(":android")
include(":desktop")
include(":common")