diff --git a/.github/workflows/plugin-e2e.yml b/.github/workflows/plugin-e2e.yml index 235b041a5..5286f2d77 100644 --- a/.github/workflows/plugin-e2e.yml +++ b/.github/workflows/plugin-e2e.yml @@ -10,7 +10,6 @@ on: - nx-gradle create-nx-gradle-workspace - nx-gradle gradle-root-directory e2e - nx-gradle gradle-root-directory kotlin dsl e2e - - nx-gradle kmp kotlin dsl e2e - nx-gradle micronaut e2e - nx-gradle micronaut kotlin dsl e2e - nx-gradle all e2e diff --git a/packages/common/src/lib/types/index.ts b/packages/common/src/lib/types/index.ts index 19bcb3419..314ad96db 100644 --- a/packages/common/src/lib/types/index.ts +++ b/packages/common/src/lib/types/index.ts @@ -10,12 +10,7 @@ export type CustomCli = | 'create-nx-gradle-workspace'; export type TargetsType = Record; export type FrameworkType = 'spring-boot' | 'quarkus' | 'micronaut' | 'none'; -export type PresetType = - | 'spring-boot' - | 'quarkus' - | 'micronaut' - | 'kmp' - | 'none'; +export type PresetType = 'spring-boot' | 'quarkus' | 'micronaut' | 'none'; export type DependencyManagementType = | 'bom' | 'spring-boot-parent-pom' diff --git a/packages/create-nx-gradle-workspace/bin/index.ts b/packages/create-nx-gradle-workspace/bin/index.ts index 6ed7cc095..ecc52b9cc 100644 --- a/packages/create-nx-gradle-workspace/bin/index.ts +++ b/packages/create-nx-gradle-workspace/bin/index.ts @@ -95,7 +95,6 @@ async function main() { { name: 'spring-boot', message: 'Spring Boot' }, { name: 'quarkus', message: 'Quarkus' }, { name: 'micronaut', message: 'Micronaut' }, - { name: 'kmp', message: 'Kotlin Multiplatform' }, { name: 'none', message: 'None' }, ], }) diff --git a/packages/nx-gradle/generators.json b/packages/nx-gradle/generators.json index c21222ea1..cfafaf241 100644 --- a/packages/nx-gradle/generators.json +++ b/packages/nx-gradle/generators.json @@ -27,11 +27,6 @@ "x-type": "library", "description": "library generator" }, - "kmp": { - "factory": "./src/generators/kmp/generator", - "schema": "./src/generators/kmp/schema.json", - "description": "kotlin multiplatform generator" - }, "preset": { "factory": "./src/generators/preset/generator", "schema": "./src/generators/preset/schema.json", diff --git a/packages/nx-gradle/src/generators/init/generator.ts b/packages/nx-gradle/src/generators/init/generator.ts index 09d48e9a1..ef77bc830 100644 --- a/packages/nx-gradle/src/generators/init/generator.ts +++ b/packages/nx-gradle/src/generators/init/generator.ts @@ -43,8 +43,7 @@ function normalizeOptions( tree: Tree, options: NxGradleInitGeneratorSchema, ): NormalizedSchema { - const kotlinExtension = - options.dsl === 'kotlin' || options.preset === 'kmp' ? '.kts' : ''; + const kotlinExtension = options.dsl === 'kotlin' ? '.kts' : ''; const generateRepositories = process.env['NODE_ENV'] === 'test'; diff --git a/packages/nx-gradle/src/generators/init/schema.json b/packages/nx-gradle/src/generators/init/schema.json index 02abb4430..8a370de94 100644 --- a/packages/nx-gradle/src/generators/init/schema.json +++ b/packages/nx-gradle/src/generators/init/schema.json @@ -65,7 +65,7 @@ "description": "preset", "type": "string", "default": "spring-boot", - "enum": ["spring-boot", "quarkus", "micronaut", "kmp", "none"], + "enum": ["spring-boot", "quarkus", "micronaut", "none"], "x-prompt": { "message": "Which preset to use? or 'none' to skip.", "type": "list", @@ -82,10 +82,6 @@ "value": "micronaut", "label": "Micronaut" }, - { - "value": "kmp", - "label": "Kotlin Multiplatform" - }, { "value": "none", "label": "None" diff --git a/packages/nx-gradle/src/generators/kmp/files/android-app/build.gradle.kts b/packages/nx-gradle/src/generators/kmp/files/android-app/build.gradle.kts deleted file mode 100644 index c1ecb8769..000000000 --- a/packages/nx-gradle/src/generators/kmp/files/android-app/build.gradle.kts +++ /dev/null @@ -1,40 +0,0 @@ -val javaVersion: String by project - -plugins { - kotlin("multiplatform") - id("com.android.application") - id("org.jetbrains.compose") -} - -kotlin { - android() - sourceSets { - val androidMain by getting { - dependencies { - implementation(project("<%= sharedLibProjectPath %>")) - } - } - } -} - -android { - compileSdk = (findProperty("android.compileSdk") as String).toInt() - namespace = "<%= packageName %>" - - sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") - - defaultConfig { - applicationId = "<%= packageName %>.<%= appName %>" - minSdk = (findProperty("android.minSdk") as String).toInt() - targetSdk = (findProperty("android.targetSdk") as String).toInt() - versionCode = 1 - versionName = "1.0" - } - compileOptions { - sourceCompatibility = JavaVersion.toVersion(javaVersion) - targetCompatibility = JavaVersion.toVersion(javaVersion) - } - kotlin { - jvmToolchain(javaVersion.toInt()) - } -} diff --git a/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/AndroidManifest.xml b/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/AndroidManifest.xml deleted file mode 100644 index 86ce26f39..000000000 --- a/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/AndroidManifest.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - diff --git a/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/kotlin/__packageDirectory__/MainActivity.kt b/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/kotlin/__packageDirectory__/MainActivity.kt deleted file mode 100644 index a727845a7..000000000 --- a/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/kotlin/__packageDirectory__/MainActivity.kt +++ /dev/null @@ -1,16 +0,0 @@ -package <%= packageName %> - -import MainView -import android.os.Bundle -import androidx.activity.compose.setContent -import androidx.appcompat.app.AppCompatActivity - -class MainActivity : AppCompatActivity() { - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - - setContent { - MainView() - } - } -} \ No newline at end of file diff --git a/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/drawable-v24/ic_launcher_foreground.xml b/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/drawable-v24/ic_launcher_foreground.xml deleted file mode 100644 index 2b068d114..000000000 --- a/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/drawable-v24/ic_launcher_foreground.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/drawable/ic_launcher_background.xml b/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/drawable/ic_launcher_background.xml deleted file mode 100644 index 07d5da9cb..000000000 --- a/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/drawable/ic_launcher_background.xml +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-anydpi-v26/ic_launcher.xml b/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-anydpi-v26/ic_launcher.xml deleted file mode 100644 index eca70cfe5..000000000 --- a/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-anydpi-v26/ic_launcher.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-anydpi-v26/ic_launcher_round.xml b/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-anydpi-v26/ic_launcher_round.xml deleted file mode 100644 index eca70cfe5..000000000 --- a/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-hdpi/ic_launcher.png b/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index a571e6009..000000000 Binary files a/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-hdpi/ic_launcher_round.png b/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-hdpi/ic_launcher_round.png deleted file mode 100644 index 61da551c5..000000000 Binary files a/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-hdpi/ic_launcher_round.png and /dev/null differ diff --git a/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-mdpi/ic_launcher.png b/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index c41dd2853..000000000 Binary files a/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-mdpi/ic_launcher_round.png b/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-mdpi/ic_launcher_round.png deleted file mode 100644 index db5080a75..000000000 Binary files a/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-mdpi/ic_launcher_round.png and /dev/null differ diff --git a/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-xhdpi/ic_launcher.png b/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index 6dba46dab..000000000 Binary files a/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-xhdpi/ic_launcher_round.png b/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-xhdpi/ic_launcher_round.png deleted file mode 100644 index da31a871c..000000000 Binary files a/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-xhdpi/ic_launcher_round.png and /dev/null differ diff --git a/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-xxhdpi/ic_launcher.png b/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index 15ac68172..000000000 Binary files a/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-xxhdpi/ic_launcher_round.png b/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-xxhdpi/ic_launcher_round.png deleted file mode 100644 index b216f2d31..000000000 Binary files a/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-xxhdpi/ic_launcher_round.png and /dev/null differ diff --git a/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-xxxhdpi/ic_launcher.png b/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index f25a41974..000000000 Binary files a/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-xxxhdpi/ic_launcher_round.png b/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-xxxhdpi/ic_launcher_round.png deleted file mode 100644 index e96783ccc..000000000 Binary files a/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/mipmap-xxxhdpi/ic_launcher_round.png and /dev/null differ diff --git a/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/values/strings.xml b/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/values/strings.xml deleted file mode 100644 index 592270bf5..000000000 --- a/packages/nx-gradle/src/generators/kmp/files/android-app/src/androidMain/res/values/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - My application - \ No newline at end of file diff --git a/packages/nx-gradle/src/generators/kmp/files/desktop-app/build.gradle.kts b/packages/nx-gradle/src/generators/kmp/files/desktop-app/build.gradle.kts deleted file mode 100644 index ad5e12314..000000000 --- a/packages/nx-gradle/src/generators/kmp/files/desktop-app/build.gradle.kts +++ /dev/null @@ -1,30 +0,0 @@ -import org.jetbrains.compose.desktop.application.dsl.TargetFormat - -plugins { - kotlin("multiplatform") - id("org.jetbrains.compose") -} - -kotlin { - jvm() - sourceSets { - val jvmMain by getting { - dependencies { - implementation(compose.desktop.currentOs) - implementation(project("<%= sharedLibProjectPath %>")) - } - } - } -} - -compose.desktop { - application { - mainClass = "MainKt" - - nativeDistributions { - targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb) - packageName = "KotlinMultiplatformComposeDesktopApplication" - packageVersion = "1.0.0" - } - } -} diff --git a/packages/nx-gradle/src/generators/kmp/files/desktop-app/src/jvmMain/kotlin/main.kt b/packages/nx-gradle/src/generators/kmp/files/desktop-app/src/jvmMain/kotlin/main.kt deleted file mode 100644 index 5ffada98e..000000000 --- a/packages/nx-gradle/src/generators/kmp/files/desktop-app/src/jvmMain/kotlin/main.kt +++ /dev/null @@ -1,8 +0,0 @@ -import androidx.compose.ui.window.Window -import androidx.compose.ui.window.application - -fun main() = application { - Window(onCloseRequest = ::exitApplication) { - MainView() - } -} \ No newline at end of file diff --git a/packages/nx-gradle/src/generators/kmp/files/ios-app/Configuration/Config.xcconfig b/packages/nx-gradle/src/generators/kmp/files/ios-app/Configuration/Config.xcconfig deleted file mode 100644 index 15946825b..000000000 --- a/packages/nx-gradle/src/generators/kmp/files/ios-app/Configuration/Config.xcconfig +++ /dev/null @@ -1,3 +0,0 @@ -TEAM_ID= -BUNDLE_ID=<%= packageName %>.<%= appName %> -APP_NAME=<%= appName %> diff --git a/packages/nx-gradle/src/generators/kmp/files/ios-app/Podfile b/packages/nx-gradle/src/generators/kmp/files/ios-app/Podfile deleted file mode 100644 index a6763af84..000000000 --- a/packages/nx-gradle/src/generators/kmp/files/ios-app/Podfile +++ /dev/null @@ -1,5 +0,0 @@ -target 'iosApp' do - use_frameworks! - platform :ios, '14.1' - pod 'shared', :path => '<%= relativePathToSharedLib %>' -end \ No newline at end of file diff --git a/packages/nx-gradle/src/generators/kmp/files/ios-app/iosApp.xcodeproj/project.pbxproj b/packages/nx-gradle/src/generators/kmp/files/ios-app/iosApp.xcodeproj/project.pbxproj deleted file mode 100644 index df8fc264e..000000000 --- a/packages/nx-gradle/src/generators/kmp/files/ios-app/iosApp.xcodeproj/project.pbxproj +++ /dev/null @@ -1,418 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 51; - objects = { - -/* Begin PBXBuildFile section */ - 058557BB273AAA24004C7B11 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 058557BA273AAA24004C7B11 /* Assets.xcassets */; }; - 058557D9273AAEEB004C7B11 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */; }; - 2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2152FB032600AC8F00CF470E /* iOSApp.swift */; }; - 7555FF83242A565900829871 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7555FF82242A565900829871 /* ContentView.swift */; }; - CFDB58B53BB94DE262B13C24 /* Pods_iosApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B1049432C0C2B312090ABF6 /* Pods_iosApp.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 058557BA273AAA24004C7B11 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; - 2152FB032600AC8F00CF470E /* iOSApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSApp.swift; sourceTree = ""; }; - 4FF3202A603A284706412EDC /* Pods-iosApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.debug.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.debug.xcconfig"; sourceTree = ""; }; - 6B1049432C0C2B312090ABF6 /* Pods_iosApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_iosApp.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 7555FF7B242A565900829871 /* My application.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "My application.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - 7555FF82242A565900829871 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; - 7555FF8C242A565B00829871 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - AB3632DC29227652001CCB65 /* Config.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Config.xcconfig; sourceTree = ""; }; - FF8CA3F5360CEAB49D74065F /* Pods-iosApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.release.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.release.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - F85CB1118929364A9C6EFABC /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - CFDB58B53BB94DE262B13C24 /* Pods_iosApp.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 058557D7273AAEEB004C7B11 /* Preview Content */ = { - isa = PBXGroup; - children = ( - 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */, - ); - path = "Preview Content"; - sourceTree = ""; - }; - 42799AB246E5F90AF97AA0EF /* Frameworks */ = { - isa = PBXGroup; - children = ( - 6B1049432C0C2B312090ABF6 /* Pods_iosApp.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 7555FF72242A565900829871 = { - isa = PBXGroup; - children = ( - AB1DB47929225F7C00F7AF9C /* Configuration */, - 7555FF7D242A565900829871 /* iosApp */, - 7555FF7C242A565900829871 /* Products */, - FEFF387C0A8D172AA4D59CAE /* Pods */, - 42799AB246E5F90AF97AA0EF /* Frameworks */, - ); - sourceTree = ""; - }; - 7555FF7C242A565900829871 /* Products */ = { - isa = PBXGroup; - children = ( - 7555FF7B242A565900829871 /* My application.app */, - ); - name = Products; - sourceTree = ""; - }; - 7555FF7D242A565900829871 /* iosApp */ = { - isa = PBXGroup; - children = ( - 058557BA273AAA24004C7B11 /* Assets.xcassets */, - 7555FF82242A565900829871 /* ContentView.swift */, - 7555FF8C242A565B00829871 /* Info.plist */, - 2152FB032600AC8F00CF470E /* iOSApp.swift */, - 058557D7273AAEEB004C7B11 /* Preview Content */, - ); - path = iosApp; - sourceTree = ""; - }; - AB1DB47929225F7C00F7AF9C /* Configuration */ = { - isa = PBXGroup; - children = ( - AB3632DC29227652001CCB65 /* Config.xcconfig */, - ); - path = Configuration; - sourceTree = ""; - }; - FEFF387C0A8D172AA4D59CAE /* Pods */ = { - isa = PBXGroup; - children = ( - 4FF3202A603A284706412EDC /* Pods-iosApp.debug.xcconfig */, - FF8CA3F5360CEAB49D74065F /* Pods-iosApp.release.xcconfig */, - ); - path = Pods; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 7555FF7A242A565900829871 /* iosApp */ = { - isa = PBXNativeTarget; - buildConfigurationList = 7555FFA5242A565B00829871 /* Build configuration list for PBXNativeTarget "iosApp" */; - buildPhases = ( - 98D614C51D2DA07C614CC46E /* [CP] Check Pods Manifest.lock */, - 7555FF77242A565900829871 /* Sources */, - 7555FF79242A565900829871 /* Resources */, - F85CB1118929364A9C6EFABC /* Frameworks */, - 2134C13603D0B299603D9F49 /* [CP] Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = iosApp; - productName = iosApp; - productReference = 7555FF7B242A565900829871 /* My application.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 7555FF73242A565900829871 /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 1130; - LastUpgradeCheck = 1130; - ORGANIZATIONNAME = orgName; - TargetAttributes = { - 7555FF7A242A565900829871 = { - CreatedOnToolsVersion = 11.3.1; - }; - }; - }; - buildConfigurationList = 7555FF76242A565900829871 /* Build configuration list for PBXProject "iosApp" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 7555FF72242A565900829871; - productRefGroup = 7555FF7C242A565900829871 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 7555FF7A242A565900829871 /* iosApp */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 7555FF79242A565900829871 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 058557D9273AAEEB004C7B11 /* Preview Assets.xcassets in Resources */, - 058557BB273AAA24004C7B11 /* Assets.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 2134C13603D0B299603D9F49 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-resources-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Copy Pods Resources"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-resources-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - 98D614C51D2DA07C614CC46E /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-iosApp-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 7555FF77242A565900829871 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */, - 7555FF83242A565900829871 /* ContentView.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 7555FFA3242A565B00829871 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = AB3632DC29227652001CCB65 /* Config.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.1; - MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; - MTL_FAST_MATH = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - 7555FFA4242A565B00829871 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = AB3632DC29227652001CCB65 /* Config.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.1; - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; - SDKROOT = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 7555FFA6242A565B00829871 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 4FF3202A603A284706412EDC /* Pods-iosApp.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_IDENTITY = "Apple Development"; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; - DEVELOPMENT_TEAM = "${TEAM_ID}"; - ENABLE_PREVIEWS = YES; - INFOPLIST_FILE = iosApp/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 14.1; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}"; - PRODUCT_NAME = "${APP_NAME}"; - PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 7555FFA7242A565B00829871 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = FF8CA3F5360CEAB49D74065F /* Pods-iosApp.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_IDENTITY = "Apple Development"; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; - DEVELOPMENT_TEAM = "${TEAM_ID}"; - ENABLE_PREVIEWS = YES; - INFOPLIST_FILE = iosApp/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 14.1; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}"; - PRODUCT_NAME = "${APP_NAME}"; - PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 7555FF76242A565900829871 /* Build configuration list for PBXProject "iosApp" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 7555FFA3242A565B00829871 /* Debug */, - 7555FFA4242A565B00829871 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 7555FFA5242A565B00829871 /* Build configuration list for PBXNativeTarget "iosApp" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 7555FFA6242A565B00829871 /* Debug */, - 7555FFA7242A565B00829871 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 7555FF73242A565900829871 /* Project object */; -} diff --git a/packages/nx-gradle/src/generators/kmp/files/ios-app/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json b/packages/nx-gradle/src/generators/kmp/files/ios-app/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json deleted file mode 100644 index 0afb3cf0e..000000000 --- a/packages/nx-gradle/src/generators/kmp/files/ios-app/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "colors": [ - { - "idiom": "universal" - } - ], - "info": { - "author": "xcode", - "version": 1 - } -} diff --git a/packages/nx-gradle/src/generators/kmp/files/ios-app/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/nx-gradle/src/generators/kmp/files/ios-app/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index bdf2efb28..000000000 --- a/packages/nx-gradle/src/generators/kmp/files/ios-app/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "images": [ - { - "filename": "app-icon-1024.png", - "idiom": "universal", - "platform": "ios", - "size": "1024x1024" - } - ], - "info": { - "author": "xcode", - "version": 1 - } -} diff --git a/packages/nx-gradle/src/generators/kmp/files/ios-app/iosApp/Assets.xcassets/AppIcon.appiconset/app-icon-1024.png b/packages/nx-gradle/src/generators/kmp/files/ios-app/iosApp/Assets.xcassets/AppIcon.appiconset/app-icon-1024.png deleted file mode 100644 index 53fc536fb..000000000 Binary files a/packages/nx-gradle/src/generators/kmp/files/ios-app/iosApp/Assets.xcassets/AppIcon.appiconset/app-icon-1024.png and /dev/null differ diff --git a/packages/nx-gradle/src/generators/kmp/files/ios-app/iosApp/Assets.xcassets/Contents.json b/packages/nx-gradle/src/generators/kmp/files/ios-app/iosApp/Assets.xcassets/Contents.json deleted file mode 100644 index 74d6a722c..000000000 --- a/packages/nx-gradle/src/generators/kmp/files/ios-app/iosApp/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info": { - "author": "xcode", - "version": 1 - } -} diff --git a/packages/nx-gradle/src/generators/kmp/files/ios-app/iosApp/ContentView.swift b/packages/nx-gradle/src/generators/kmp/files/ios-app/iosApp/ContentView.swift deleted file mode 100644 index f7f6457b3..000000000 --- a/packages/nx-gradle/src/generators/kmp/files/ios-app/iosApp/ContentView.swift +++ /dev/null @@ -1,21 +0,0 @@ -import UIKit -import SwiftUI -import shared - -struct ComposeView: UIViewControllerRepresentable { - func makeUIViewController(context: Context) -> UIViewController { - Main_iosKt.MainViewController() - } - - func updateUIViewController(_ uiViewController: UIViewController, context: Context) {} -} - -struct ContentView: View { - var body: some View { - ComposeView() - .ignoresSafeArea(.keyboard) // Compose has own keyboard handler - } -} - - - diff --git a/packages/nx-gradle/src/generators/kmp/files/ios-app/iosApp/Info.plist b/packages/nx-gradle/src/generators/kmp/files/ios-app/iosApp/Info.plist deleted file mode 100644 index 412e37812..000000000 --- a/packages/nx-gradle/src/generators/kmp/files/ios-app/iosApp/Info.plist +++ /dev/null @@ -1,50 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - $(PRODUCT_BUNDLE_PACKAGE_TYPE) - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSRequiresIPhoneOS - - CADisableMinimumFrameDurationOnPhone - - UIApplicationSceneManifest - - UIApplicationSupportsMultipleScenes - - - UILaunchScreen - - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/packages/nx-gradle/src/generators/kmp/files/ios-app/iosApp/Preview Content/Preview Assets.xcassets/Contents.json b/packages/nx-gradle/src/generators/kmp/files/ios-app/iosApp/Preview Content/Preview Assets.xcassets/Contents.json deleted file mode 100644 index 74d6a722c..000000000 --- a/packages/nx-gradle/src/generators/kmp/files/ios-app/iosApp/Preview Content/Preview Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info": { - "author": "xcode", - "version": 1 - } -} diff --git a/packages/nx-gradle/src/generators/kmp/files/ios-app/iosApp/iOSApp.swift b/packages/nx-gradle/src/generators/kmp/files/ios-app/iosApp/iOSApp.swift deleted file mode 100644 index 0648e8602..000000000 --- a/packages/nx-gradle/src/generators/kmp/files/ios-app/iosApp/iOSApp.swift +++ /dev/null @@ -1,10 +0,0 @@ -import SwiftUI - -@main -struct iOSApp: App { - var body: some Scene { - WindowGroup { - ContentView() - } - } -} \ No newline at end of file diff --git a/packages/nx-gradle/src/generators/kmp/files/shared-lib/build.gradle.kts b/packages/nx-gradle/src/generators/kmp/files/shared-lib/build.gradle.kts deleted file mode 100644 index 49f1e1771..000000000 --- a/packages/nx-gradle/src/generators/kmp/files/shared-lib/build.gradle.kts +++ /dev/null @@ -1,85 +0,0 @@ -val javaVersion: String by project - -plugins { - kotlin("multiplatform") - kotlin("native.cocoapods") - id("com.android.library") - id("org.jetbrains.compose") -} - -kotlin { - android() - - jvm("desktop") - - iosX64() - iosArm64() - iosSimulatorArm64() - - cocoapods { - version = "1.0.0" - summary = "Some description for the Shared Module" - homepage = "Link to the Shared Module homepage" - ios.deploymentTarget = "14.1" - podfile = project.file("<%= relativePathToPodfile %>/Podfile") - framework { - baseName = "<%= sharedLibName %>" - isStatic = true - } - extraSpecAttributes["resources"] = "['src/commonMain/resources/**', 'src/iosMain/resources/**']" - } - - sourceSets { - val commonMain by getting { - dependencies { - implementation(compose.runtime) - implementation(compose.foundation) - implementation(compose.material) - @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) - implementation(compose.components.resources) - } - } - val androidMain by getting { - dependencies { - api("androidx.activity:activity-compose:1.6.1") - api("androidx.appcompat:appcompat:1.6.1") - api("androidx.core:core-ktx:1.9.0") - } - } - val iosX64Main by getting - val iosArm64Main by getting - val iosSimulatorArm64Main by getting - val iosMain by creating { - dependsOn(commonMain) - iosX64Main.dependsOn(this) - iosArm64Main.dependsOn(this) - iosSimulatorArm64Main.dependsOn(this) - } - val desktopMain by getting { - dependencies { - implementation(compose.desktop.common) - } - } - } -} - -android { - compileSdk = (findProperty("android.compileSdk") as String).toInt() - namespace = "<%= packageName %>.common" - - sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") - sourceSets["main"].res.srcDirs("src/androidMain/res") - sourceSets["main"].resources.srcDirs("src/commonMain/resources") - - defaultConfig { - minSdk = (findProperty("android.minSdk") as String).toInt() - targetSdk = (findProperty("android.targetSdk") as String).toInt() - } - compileOptions { - sourceCompatibility = JavaVersion.toVersion(javaVersion) - targetCompatibility = JavaVersion.toVersion(javaVersion) - } - kotlin { - jvmToolchain(javaVersion.toInt()) - } -} diff --git a/packages/nx-gradle/src/generators/kmp/files/shared-lib/src/androidMain/AndroidManifest.xml b/packages/nx-gradle/src/generators/kmp/files/shared-lib/src/androidMain/AndroidManifest.xml deleted file mode 100644 index 568741e54..000000000 --- a/packages/nx-gradle/src/generators/kmp/files/shared-lib/src/androidMain/AndroidManifest.xml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/packages/nx-gradle/src/generators/kmp/files/shared-lib/src/androidMain/kotlin/main.android.kt b/packages/nx-gradle/src/generators/kmp/files/shared-lib/src/androidMain/kotlin/main.android.kt deleted file mode 100644 index 9c4fd5b90..000000000 --- a/packages/nx-gradle/src/generators/kmp/files/shared-lib/src/androidMain/kotlin/main.android.kt +++ /dev/null @@ -1,3 +0,0 @@ -import androidx.compose.runtime.Composable -actual fun getPlatformName(): String = "Android" -@Composable fun MainView() = App() diff --git a/packages/nx-gradle/src/generators/kmp/files/shared-lib/src/commonMain/kotlin/App.kt b/packages/nx-gradle/src/generators/kmp/files/shared-lib/src/commonMain/kotlin/App.kt deleted file mode 100644 index 0889bdd26..000000000 --- a/packages/nx-gradle/src/generators/kmp/files/shared-lib/src/commonMain/kotlin/App.kt +++ /dev/null @@ -1,41 +0,0 @@ -import androidx.compose.animation.AnimatedVisibility -import androidx.compose.foundation.Image -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.material.Button -import androidx.compose.material.MaterialTheme -import androidx.compose.material.Text -import androidx.compose.runtime.Composable -import androidx.compose.runtime.getValue -import androidx.compose.runtime.mutableStateOf -import androidx.compose.runtime.remember -import androidx.compose.runtime.setValue -import androidx.compose.ui.Alignment -import androidx.compose.ui.Modifier -import org.jetbrains.compose.resources.ExperimentalResourceApi -import org.jetbrains.compose.resources.painterResource - -@OptIn(ExperimentalResourceApi::class) -@Composable -fun App() { - MaterialTheme { - var greetingText by remember { mutableStateOf("Hello, World!") } - var showImage by remember { mutableStateOf(false) } - Column(Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally) { - Button(onClick = { - greetingText = "Hello, ${getPlatformName()}" - showImage = !showImage - }) { - Text(greetingText) - } - AnimatedVisibility(showImage) { - Image( - painterResource("compose-multiplatform.xml"), - null - ) - } - } - } -} - -expect fun getPlatformName(): String \ No newline at end of file diff --git a/packages/nx-gradle/src/generators/kmp/files/shared-lib/src/commonMain/resources/compose-multiplatform.xml b/packages/nx-gradle/src/generators/kmp/files/shared-lib/src/commonMain/resources/compose-multiplatform.xml deleted file mode 100644 index d7bf7955f..000000000 --- a/packages/nx-gradle/src/generators/kmp/files/shared-lib/src/commonMain/resources/compose-multiplatform.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - diff --git a/packages/nx-gradle/src/generators/kmp/files/shared-lib/src/desktopMain/kotlin/main.desktop.kt b/packages/nx-gradle/src/generators/kmp/files/shared-lib/src/desktopMain/kotlin/main.desktop.kt deleted file mode 100644 index e9744e6e6..000000000 --- a/packages/nx-gradle/src/generators/kmp/files/shared-lib/src/desktopMain/kotlin/main.desktop.kt +++ /dev/null @@ -1,9 +0,0 @@ -import androidx.compose.desktop.ui.tooling.preview.Preview -import androidx.compose.runtime.Composable -actual fun getPlatformName(): String = "Desktop" -@Composable fun MainView() = App() -@Preview -@Composable -fun AppPreview() { - App() -} diff --git a/packages/nx-gradle/src/generators/kmp/files/shared-lib/src/iosMain/kotlin/main.ios.kt b/packages/nx-gradle/src/generators/kmp/files/shared-lib/src/iosMain/kotlin/main.ios.kt deleted file mode 100644 index 9d2eaedf8..000000000 --- a/packages/nx-gradle/src/generators/kmp/files/shared-lib/src/iosMain/kotlin/main.ios.kt +++ /dev/null @@ -1,3 +0,0 @@ -import androidx.compose.ui.window.ComposeUIViewController -actual fun getPlatformName(): String = "iOS" -fun MainViewController() = ComposeUIViewController { App() } diff --git a/packages/nx-gradle/src/generators/kmp/generator.ts b/packages/nx-gradle/src/generators/kmp/generator.ts deleted file mode 100644 index 0482db321..000000000 --- a/packages/nx-gradle/src/generators/kmp/generator.ts +++ /dev/null @@ -1,393 +0,0 @@ -import { normalizeName } from '@jnxplus/common'; -import { - ProjectConfiguration, - Tree, - addProjectConfiguration, - formatFiles, - generateFiles, - joinPathFragments, - names, - offsetFromRoot, - workspaceRoot, -} from '@nx/devkit'; -import * as fs from 'fs'; -import { fileExists } from 'nx/src/utils/fileutils'; -import * as path from 'path'; -import { - getGradleRootDirectory, - getProjectPathFromProjectRoot, - getRootProjectName, -} from '../../utils'; -import { addProjectToGradleSetting } from '../../utils'; -import { NxGradleKotlinMultiplatformGeneratorSchema } from './schema'; - -interface NormalizedSchema extends NxGradleKotlinMultiplatformGeneratorSchema { - androidAppName: string; - iosAppName: string; - desktopAppName: string; - sharedLibName: string; - androidAppRoot: string; - iosAppRoot: string; - desktopAppRoot: string; - sharedLibRoot: string; - androidAppDirectory: string; - iosAppDirectory: string; - desktopAppDirectory: string; - sharedLibDirectory: string; - sharedLibProjectPath: string; - rootProjectName: string; - parsedTags: string[]; - packageName: string; - packageDirectory: string; - relativePathToSharedLib: string; - relativePathToPodfile: string; - appName: string; - gradleRootDirectory: string; -} - -function normalizeOptions( - tree: Tree, - options: NxGradleKotlinMultiplatformGeneratorSchema, -): NormalizedSchema { - const prefix = names(normalizeName(options.name)).fileName; - - let androidAppName: string; - let iosAppName: string; - let desktopAppName: string; - let sharedLibName: string; - - if (options.simpleName || !options.directory) { - androidAppName = `${prefix}-android`; - iosAppName = `${prefix}-ios`; - desktopAppName = `${prefix}-desktop`; - sharedLibName = `${prefix}-shared`; - } else { - androidAppName = `${normalizeName( - names(options.directory).fileName, - )}-${prefix}-android`; - iosAppName = `${normalizeName( - names(options.directory).fileName, - )}-${prefix}-ios`; - desktopAppName = `${normalizeName( - names(options.directory).fileName, - )}-${prefix}-desktop`; - sharedLibName = `${normalizeName( - names(options.directory).fileName, - )}-${prefix}-shared`; - } - - const gradleRootDirectory = getGradleRootDirectory(); - - const androidAppDirectory = options.directory - ? `${names(options.directory).fileName}/${androidAppName}` - : `${androidAppName}`; - const androidAppRoot = joinPathFragments( - gradleRootDirectory, - androidAppDirectory, - ); - - const iosAppDirectory = options.directory - ? `${names(options.directory).fileName}/${iosAppName}` - : `${iosAppName}`; - - const iosAppRoot = joinPathFragments(gradleRootDirectory, iosAppDirectory); - - const desktopAppDirectory = options.directory - ? `${names(options.directory).fileName}/${desktopAppName}` - : `${desktopAppName}`; - const desktopAppRoot = joinPathFragments( - gradleRootDirectory, - desktopAppDirectory, - ); - - const sharedLibDirectory = options.directory - ? `${names(options.directory).fileName}/${sharedLibName}` - : `${sharedLibName}`; - const sharedLibRoot = joinPathFragments( - gradleRootDirectory, - sharedLibDirectory, - ); - - const sharedLibProjectPath = `:${getProjectPathFromProjectRoot( - sharedLibRoot, - gradleRootDirectory, - )}`; - - const settingsGradleKtsPath = path.join(workspaceRoot, 'settings.gradle.kts'); - const isSettingsGradleKtsExists = fileExists(settingsGradleKtsPath); - - let rootProjectName = ''; - if (isSettingsGradleKtsExists) { - const settingsGradleKtsContent = fs.readFileSync( - settingsGradleKtsPath, - 'utf-8', - ); - rootProjectName = getRootProjectName(settingsGradleKtsContent); - } - - const parsedTags = options.tags - ? options.tags.split(',').map((s) => s.trim()) - : []; - - let packageName: string; - if (options.simplePackageName || !options.directory) { - packageName = `${options.groupId}.${names( - prefix, - ).className.toLocaleLowerCase()}`.replace(new RegExp(/-/, 'g'), ''); - } else { - packageName = `${options.groupId}.${`${names( - options.directory, - ).fileName.replace(new RegExp(/\//, 'g'), '.')}.${names( - prefix, - ).className.toLocaleLowerCase()}`}`.replace(new RegExp(/-/, 'g'), ''); - } - - const packageDirectory = packageName.replace(new RegExp(/\./, 'g'), '/'); - - const relativePathToSharedLib = path - .relative( - path.join(workspaceRoot, iosAppRoot), - path.join(workspaceRoot, sharedLibRoot), - ) - .replace(new RegExp(/\\/, 'g'), '/'); - - const relativePathToPodfile = path - .relative( - path.join(workspaceRoot, sharedLibRoot), - path.join(workspaceRoot, iosAppRoot), - ) - .replace(new RegExp(/\\/, 'g'), '/'); - - const appName = names(prefix).className; - - return { - ...options, - androidAppName, - iosAppName, - desktopAppName, - sharedLibName, - androidAppRoot, - iosAppRoot, - desktopAppRoot, - sharedLibRoot, - androidAppDirectory, - iosAppDirectory, - desktopAppDirectory, - sharedLibDirectory, - sharedLibProjectPath, - rootProjectName, - parsedTags, - packageName, - packageDirectory, - relativePathToSharedLib, - relativePathToPodfile, - appName, - gradleRootDirectory, - }; -} - -function addAndroidFiles(tree: Tree, options: NormalizedSchema) { - const templateOptions = { - ...options, - offsetFromRoot: offsetFromRoot(tree.root), - template: '', - }; - generateFiles( - tree, - path.join(__dirname, 'files', 'android-app'), - options.androidAppRoot, - templateOptions, - ); -} - -function addIosFiles(tree: Tree, options: NormalizedSchema) { - const templateOptions = { - ...options, - offsetFromRoot: offsetFromRoot(tree.root), - template: '', - }; - generateFiles( - tree, - path.join(__dirname, 'files', 'ios-app'), - options.iosAppRoot, - templateOptions, - ); -} - -function addDesktopFiles(tree: Tree, options: NormalizedSchema) { - const templateOptions = { - ...options, - offsetFromRoot: offsetFromRoot(tree.root), - template: '', - }; - generateFiles( - tree, - path.join(__dirname, 'files', 'desktop-app'), - options.desktopAppRoot, - templateOptions, - ); -} - -function addSharedFiles(tree: Tree, options: NormalizedSchema) { - const templateOptions = { - ...options, - offsetFromRoot: offsetFromRoot(tree.root), - template: '', - }; - generateFiles( - tree, - path.join(__dirname, 'files', 'shared-lib'), - options.sharedLibRoot, - templateOptions, - ); -} - -function generateAndroidApp(normalizedOptions: NormalizedSchema, tree: Tree) { - const projectConfiguration: ProjectConfiguration = { - root: normalizedOptions.androidAppRoot, - projectType: 'application', - sourceRoot: `./${normalizedOptions.androidAppRoot}/src`, - targets: { - build: { - executor: `@jnxplus/nx-gradle:run-task`, - outputs: [`{projectRoot}/build`], - options: { - task: 'build', - }, - }, - serve: {}, - test: { - executor: `@jnxplus/nx-gradle:run-task`, - options: { - task: 'test', - }, - }, - }, - tags: normalizedOptions.parsedTags, - }; - - addProjectConfiguration( - tree, - normalizedOptions.androidAppName, - projectConfiguration, - ); - - addAndroidFiles(tree, normalizedOptions); - addProjectToGradleSetting(tree, { - projectRoot: normalizedOptions.androidAppRoot, - gradleRootDirectory: normalizedOptions.gradleRootDirectory, - }); -} - -function generateIosApp(normalizedOptions: NormalizedSchema, tree: Tree) { - const projectConfiguration: ProjectConfiguration = { - root: normalizedOptions.iosAppRoot, - projectType: 'application', - sourceRoot: `./${normalizedOptions.iosAppRoot}/src`, - targets: {}, - tags: normalizedOptions.parsedTags, - implicitDependencies: [ - normalizedOptions.sharedLibName, - //TODO normalizedOptions.rootProjectName, - ], - }; - - addProjectConfiguration( - tree, - normalizedOptions.iosAppName, - projectConfiguration, - ); - - addIosFiles(tree, normalizedOptions); -} - -function generateDesktopApp(normalizedOptions: NormalizedSchema, tree: Tree) { - const projectConfiguration: ProjectConfiguration = { - root: normalizedOptions.desktopAppRoot, - projectType: 'application', - sourceRoot: `./${normalizedOptions.desktopAppRoot}/src`, - targets: { - build: { - executor: `@jnxplus/nx-gradle:run-task`, - outputs: [`{projectRoot}/build`], - options: { - task: 'build', - }, - }, - serve: { - executor: `@jnxplus/nx-gradle:run-task`, - options: { - task: 'run', - keepItRunning: true, - }, - }, - test: { - executor: `@jnxplus/nx-gradle:run-task`, - options: { - task: 'test', - }, - }, - }, - tags: normalizedOptions.parsedTags, - }; - - addProjectConfiguration( - tree, - normalizedOptions.desktopAppName, - projectConfiguration, - ); - - addDesktopFiles(tree, normalizedOptions); - addProjectToGradleSetting(tree, { - projectRoot: normalizedOptions.desktopAppRoot, - gradleRootDirectory: normalizedOptions.gradleRootDirectory, - }); -} - -function generateSharedLib(normalizedOptions: NormalizedSchema, tree: Tree) { - const projectConfiguration: ProjectConfiguration = { - root: normalizedOptions.sharedLibRoot, - projectType: 'library', - sourceRoot: `./${normalizedOptions.sharedLibRoot}/src`, - targets: { - build: { - executor: `@jnxplus/nx-gradle:run-task`, - outputs: [`{projectRoot}/build`], - options: { - task: 'build', - }, - }, - test: { - executor: `@jnxplus/nx-gradle:run-task`, - options: { - task: 'test', - }, - }, - }, - tags: normalizedOptions.parsedTags, - }; - - addProjectConfiguration( - tree, - normalizedOptions.sharedLibName, - projectConfiguration, - ); - - addSharedFiles(tree, normalizedOptions); - addProjectToGradleSetting(tree, { - projectRoot: normalizedOptions.sharedLibRoot, - gradleRootDirectory: normalizedOptions.gradleRootDirectory, - }); -} - -export default async function ( - tree: Tree, - options: NxGradleKotlinMultiplatformGeneratorSchema, -) { - const normalizedOptions = normalizeOptions(tree, options); - generateSharedLib(normalizedOptions, tree); - generateDesktopApp(normalizedOptions, tree); - generateIosApp(normalizedOptions, tree); - generateAndroidApp(normalizedOptions, tree); - await formatFiles(tree); -} diff --git a/packages/nx-gradle/src/generators/kmp/schema.d.ts b/packages/nx-gradle/src/generators/kmp/schema.d.ts deleted file mode 100644 index 7ff375d42..000000000 --- a/packages/nx-gradle/src/generators/kmp/schema.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface NxGradleKotlinMultiplatformGeneratorSchema { - name: string; - tags?: string; - directory?: string; - groupId: string; - projectVersion?: string; - simpleName?: boolean; - simplePackageName?: boolean; -} diff --git a/packages/nx-gradle/src/generators/kmp/schema.json b/packages/nx-gradle/src/generators/kmp/schema.json deleted file mode 100644 index 1137271df..000000000 --- a/packages/nx-gradle/src/generators/kmp/schema.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "$schema": "http://json-schema.org/schema", - "$id": "NxGradleKotlinMultiplatform", - "title": "Scaffold kotlin multiplatform projects", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "", - "$default": { - "$source": "argv", - "index": 0 - }, - "x-prompt": "What name would you like to use?", - "pattern": "^[a-zA-Z].*$" - }, - "tags": { - "type": "string", - "description": "Add tags to the project (used for linting)", - "alias": "t" - }, - "directory": { - "type": "string", - "description": "A directory where the project is placed", - "alias": "dir" - }, - "groupId": { - "type": "string", - "default": "com.example", - "x-prompt": "What groupId would you like to use?" - }, - "projectVersion": { - "type": "string", - "default": "0.0.1-SNAPSHOT", - "description": "Version of the project to generate", - "alias": "v" - }, - "simpleName": { - "description": "Don't include the directory in the project name", - "type": "boolean", - "default": true - }, - "simplePackageName": { - "description": "Don't include the directory in the package name", - "type": "boolean", - "default": true - } - }, - "required": ["name", "groupId"] -} diff --git a/testing-projects/jnxplus-e2e/tests/nx-gradle/kmp-kt.spec.ts b/testing-projects/jnxplus-e2e/tests/nx-gradle/kmp-kt.spec.ts deleted file mode 100644 index a300cc5b9..000000000 --- a/testing-projects/jnxplus-e2e/tests/nx-gradle/kmp-kt.spec.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { createTestWorkspace } from '@jnxplus/internal/testing'; -import { - checkFilesExist, - readJson, - runNxCommandAsync, - uniq, -} from '@nx/plugin/testing'; -import { execSync } from 'child_process'; -import { rmSync } from 'fs'; - -describe('nx-gradle kmp kotlin dsl e2e', () => { - let workspaceDirectory: string; - - const rootProjectName = uniq('root-project-'); - - beforeAll(async () => { - workspaceDirectory = createTestWorkspace(); - - // The plugin has been built and published to a local registry in the jest globalSetup - // Install the plugin built with the latest source code into the test repo - execSync(`npm install -D @jnxplus/nx-gradle@e2e`, { - cwd: workspaceDirectory, - stdio: 'inherit', - env: process.env, - }); - - await runNxCommandAsync( - `generate @jnxplus/nx-gradle:init --dsl kotlin --rootProjectName ${rootProjectName} --preset kmp --versionManagement properties`, - ); - }, 120000); - - afterAll(async () => { - // Cleanup the test project - rmSync(workspaceDirectory, { - recursive: true, - force: true, - }); - }); - - it('should set NX_VERBOSE_LOGGING to true', async () => { - expect(process.env['NX_VERBOSE_LOGGING']).toBe('true'); - }, 120000); - - it('should use dsl option when initiating the workspace', async () => { - // Making sure the package.json file contains the @jnxplus/nx-gradle dependency - const packageJson = readJson('package.json'); - expect(packageJson.devDependencies['@jnxplus/nx-gradle']).toBeTruthy(); - - // Making sure the nx.json file contains the @jnxplus/nx-gradle inside the plugins section - //const nxJson = readJson('nx.json'); - //expect(nxJson.plugins.includes('@jnxplus/nx-gradle')).toBeTruthy(); - - expect(() => - checkFilesExist( - 'gradle/wrapper/gradle-wrapper.jar', - 'gradle/wrapper/gradle-wrapper.properties', - 'gradlew', - 'gradlew.bat', - 'gradle.properties', - 'settings.gradle.kts', - ), - ).not.toThrow(); - }, 120000); - - it('shoud works', async () => { - const name = uniq('kmp-'); - - await runNxCommandAsync(`generate @jnxplus/nx-gradle:kmp ${name}`); - }, 240000); -});