Commit Graph

187 Commits

Author SHA1 Message Date
Emre Şafak
eba6b45df7 Correct all occurrences of "compatability" (#2623) 2023-01-13 10:05:31 +01:00
Alexey Tsvetkov
472ef34fc3 Fix configuration cache issues (#2607)
Fixes #2587

* Test Gradle 7.6+ with configuration cache by default

* Make unpacking wasm runtime configuration cache compatible

* Make ProGuard integration configuration cache compatible

* Fix unresolved reference

* Fix configuration cache exception on macOS
2023-01-11 08:46:40 +01:00
Alexey Tsvetkov
57348cbde3 Fix running unsigned apps locally on macOS Ventura (#2617)
Normally macOS Gatekeeper does not allow unsigned apps to run.
However, apps created on the same machine were allowed to run.
This allows developers to test package apps on their machines
without configuring Apple Developer ID.

Previously, the Compose Multiplatform Gradle plugin
simply did not do anything, when the signing was not configured.
However, in macOS Ventura the Gatekeeper checks
became stricker, so "unsigned" packaged apps started to
be shown as "damaged".

This seems to happen, because parts of a final app image
were signed. Also they were signed by different certificates
(a runtime image could be signed by a runtime vendor,
while Skiko binary is signed by JetBrains).

This change removes all signatures if signing is not configured.

See also https://bugs.openjdk.org/browse/JDK-8276150

Fixes #2476
2023-01-10 21:08:28 +01:00
Alexey Tsvetkov
4f1bb98711 Remove usages of internal Gradle API FileOperations (#2606) 2023-01-09 12:27:11 +01:00
Christian De Angelis
d79b793131 Add task dependency on unpacking wasm. (#2589)
The `jsProcessResources` task needs to depend on the
`unpackSkikoWasmRuntimeJs` task since it explicitly consumes one of its
outputs. Otherwise, a Gradle warning occurs during compilation that task
execution optimizations have been disabled.
2023-01-02 16:44:35 +01:00
Igor Demin
be0c1c87e1 Release 1.2.2 (#2561)
* Compose 1.2.1-rc01

* Fix Web build for Kotlin 1.7.20

* Use 1.3.2.1-rc02 in Gradle plugin

* Fix Gradle Plugin tests

* Fix Gradle Plugin tests

* Compose 1.2.1-rc03

* Update CHANGELOG.md

* Update CHANGELOG.md

* Compose Compiler 1.3.2.1

* Compose 1.2.1

* Update VERSIONING.md

* Update gradle.properties

* Fix custom JDK tests on Linux

* Remove JVM target version override (#2515)

Previously, we were setting kotlin.jvmTarget version
to 1.8 if it was null or < 1.8.
As an unintended consequence we were also overriding
a version set by the jvmToolchain property.
So while users expected the jvmToolchain property
to set both jdk home & jdk target, we were quietly
overriding jdk target.

At the same time, Kotlin 1.7 sets the minimum
target version to 1.8 anyway, so our override
does not make sense with Kotlin 1.7+.

This commit removes overriding altogether.

Fixes #2511

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update Compose

* Update default ProGuard rules with changes from main branch

* Test Gradle plugin on relevant PRs (#2509)

* Update Gradle used in tooling subprojects

* Update Kotlin in Compose Gradle plugin

* Decrease verbosity of Gradle plugin tests

* Disable mac sign test

* Add workflow to test Gradle plugin

* Fix custom jdk tests on Linux

* Make Compose Gradle plugin build compatible with Configuration cache

* Print tests summary

* Remove unused code

* Refactor tests configuration

* Turn off parallel execution

* Try adding windows runner

* Turn off fail fast

* Fix Windows test issues

#2368

* Adjust default proguard rules

The following rule is needed to fix tests on Windows:
```
-dontwarn org.graalvm.compiler.core.aarch64.AArch64NodeMatchRules_MatchStatementSet*
```

Other rules are just to make builds less noisy.
Kotlin's `*.internal` packages often contain
bytecode, which triggers ProGuard's notes.
However, these notes are not actionable for
most users, so we can ignore notes by default.

#2393
# Conflicts:
#	gradle-plugins/gradle/wrapper/gradle-wrapper.properties

* Improve DSL for setting a custom Compose Plugin (#2527)

* Improve DSL for setting a custom Compose Plugin

Fixes https://github.com/JetBrains/compose-jb/issues/2459

Readme: https://github.com/JetBrains/compose-jb/pull/2526

1. Add `dependencies: Dependencies` extension that is accessible in `compose { }` block
2. Add `Dependencies.compiler` property that can return versions of Compose compiler used by the plugin:
```
compose {
    kotlinCompilerPlugin.set(dependencies.compiler.forKotlin("1.7.20"))
    //kotlinCompilerPlugin.set(dependencies.compiler.auto) // determined by applied version of Kotlin. It is a default.
}
```

3. Add ability to set arguments for Compose Compiler. Now we can write:
```
compose {
    kotlinCompilerPlugin.set(dependencies.compiler.forKotlin("1.7.20"))
    kotlinCompilerPluginArgs.add("suppressKotlinVersionCompatibilityCheck=1.7.21")
}
```

4. Remove checks for different targets

We had a separate check for JS, when we released 1.2.0. It doesn't support Kotlin 1.7.20 at that moment.

It is hard to refactor this feature in the new code, so I removed it. It is not needed now and it had an ugly code. When we will need it again, we'll write it again.

5. Remove the `compose.tests.androidx.compiler.version` property from gradle.properties and remove `defaultAndroidxCompilerEnvironment`

Because they are used only in one test, and it seems there is no reason to use it in another place in the future

* Discussions

* Update ComposeCompilerCompatability.kt (#2557)

* Update CHANGELOG.md

* 1.2.2-rc01

* Update Compose

* Update CHANGELOG.md

* Compose 1.2.2

* Remove shared.podspec

* Remove usages of deprecated Intellij APIs

Co-authored-by: Alexey Tsvetkov <alexey.tsvetkov@jetbrains.com>
Co-authored-by: Alexey Tsvetkov <654232+AlexeyTsvetkov@users.noreply.github.com>
2022-12-15 01:14:26 +01:00
Igor Demin
bb723f81a9 Update ComposeCompilerCompatability.kt (#2557) 2022-12-13 07:32:13 +01:00
Igor Demin
bf958eb510 Improve DSL for setting a custom Compose Plugin (#2527)
* Improve DSL for setting a custom Compose Plugin

Fixes https://github.com/JetBrains/compose-jb/issues/2459

Readme: https://github.com/JetBrains/compose-jb/pull/2526

1. Add `dependencies: Dependencies` extension that is accessible in `compose { }` block
2. Add `Dependencies.compiler` property that can return versions of Compose compiler used by the plugin:
```
compose {
    kotlinCompilerPlugin.set(dependencies.compiler.forKotlin("1.7.20"))
    //kotlinCompilerPlugin.set(dependencies.compiler.auto) // determined by applied version of Kotlin. It is a default.
}
```

3. Add ability to set arguments for Compose Compiler. Now we can write:
```
compose {
    kotlinCompilerPlugin.set(dependencies.compiler.forKotlin("1.7.20"))
    kotlinCompilerPluginArgs.add("suppressKotlinVersionCompatibilityCheck=1.7.21")
}
```

4. Remove checks for different targets

We had a separate check for JS, when we released 1.2.0. It doesn't support Kotlin 1.7.20 at that moment.

It is hard to refactor this feature in the new code, so I removed it. It is not needed now and it had an ugly code. When we will need it again, we'll write it again.

5. Remove the `compose.tests.androidx.compiler.version` property from gradle.properties and remove `defaultAndroidxCompilerEnvironment`

Because they are used only in one test, and it seems there is no reason to use it in another place in the future

* Discussions
2022-12-13 07:27:33 +01:00
Alexey Tsvetkov
382ad5b78f Test Gradle plugin on relevant PRs (#2509)
* Update Gradle used in tooling subprojects

* Update Kotlin in Compose Gradle plugin

* Decrease verbosity of Gradle plugin tests

* Disable mac sign test

* Add workflow to test Gradle plugin

* Fix custom jdk tests on Linux

* Make Compose Gradle plugin build compatible with Configuration cache

* Print tests summary

* Remove unused code

* Refactor tests configuration

* Turn off parallel execution

* Try adding windows runner

* Turn off fail fast

* Fix Windows test issues

#2368

* Adjust default proguard rules

The following rule is needed to fix tests on Windows:
```
-dontwarn org.graalvm.compiler.core.aarch64.AArch64NodeMatchRules_MatchStatementSet*
```

Other rules are just to make builds less noisy.
Kotlin's `*.internal` packages often contain
bytecode, which triggers ProGuard's notes.
However, these notes are not actionable for
most users, so we can ignore notes by default.

#2393
2022-11-30 14:37:05 +01:00
Alexey Tsvetkov
7e574a07e2 Remove JVM target version override (#2515)
Previously, we were setting kotlin.jvmTarget version
to 1.8 if it was null or < 1.8.
As an unintended consequence we were also overriding
a version set by the jvmToolchain property.
So while users expected the jvmToolchain property
to set both jdk home & jdk target, we were quietly
overriding jdk target.

At the same time, Kotlin 1.7 sets the minimum
target version to 1.8 anyway, so our override
does not make sense with Kotlin 1.7+.

This commit removes overriding altogether.

Fixes #2511
2022-11-29 16:15:14 +01:00
Parthasarathy
612fab6099 Allow the default window to go fullscreen (#2458)
This is an odd behaviour, but I couldn't find any other solution. If `UILaunchStoryboardName` is present, `UIScreen.mainScreen.bounds` will have proper size instead of a smaller window.
[Reference](https://stackoverflow.com/a/56950026)
2022-11-24 15:52:57 +03:00
dima.avdeev
13d1de302c [components/resources] add resource("img.png"). rememberImageBitmap() (#2483) 2022-11-22 15:52:48 +03:00
Igor Demin
f35e286958 Fix Preview compatibility with Gradle configuration cache (#2470)
* Fix Preview compatability with Gradle configuiration cache

Fixes https://github.com/JetBrains/compose-jb/issues/2376

* A test for Gradle configuration cache

And Gradle 7.5.1
2022-11-14 18:58:05 +03:00
Igor Demin
63846c63c0 Compose 1.2.1 (#2453) 2022-11-07 14:46:37 +01:00
Alexey Tsvetkov
04846b1fdd Fix custom JDK tests on Linux 2022-11-04 17:23:21 +01:00
Igor Demin
7e597c83e8 Use Compose Compiler 1.3.2.1 (#2442)
Use Compose Compiler 1.3.2.1

With Kotlin 1.7.20 support for JS
2022-11-01 18:25:18 +01:00
Alexey Tsvetkov
083e51feb9 Fix caching for checking runtime properties (#2438)
Resolves #2329
2022-10-31 18:13:27 +01:00
Alexey Tsvetkov
6501d9f9f2 Fix packaging with JDK 19 (#2439)
Resolves #2328
2022-10-31 18:13:08 +01:00
Igor Demin
0c8c752266 Fix kotlinCompilerPlugin property (#2396)
* Fix `kotlinCompilerPlugin` property

[Support multiple versions of Kotlin PR](https://github.com/JetBrains/compose-jb/pull/2366) breaks `kotlinCompilerPlugin` feature.

`customPluginString` isn't set at the moment of plugin applying (or Provider's initialization), so we need to read it only when the artifact is requested.

* Refactoring
2022-10-24 16:20:13 +02:00
Blaž Šolar
65e8e69c24 uikit deploy, split Gradle and Xcode (#2406) 2022-10-20 10:37:21 +03:00
dima.avdeev
0554616489 uikit open simulator, simplify availability condition (#2414) 2022-10-17 21:46:42 +03:00
dima.avdeev
11fad5eca7 Gradle plugin delete unavailable simulator (#2413)
* fix gradle plugin delete unavailable simulator
* apply suggestion to simpify usage of getSimctlListData()
2022-10-17 17:40:44 +03:00
Nikita Lipsky
aecf6bb9a1 Fix compose gradle plugin for iOS device deployment: (#2407)
- Move cleaning up build directory from packComposeUikitApplicationForXCode Gradle task to registerConnectedDeviceTasks as the first one runs during xcode build and could delete files placed by xcode in parallel before (such as Info.plist).

- Remove workaround of running xcodebuild twice as the original problem the most probably was provoded by incorrect build directory cleanup

- Remove sources from xcodegen configuratiom as we do not need them in the resulting .app
2022-10-17 16:50:16 +03:00
Alexey Tsvetkov
d5af9623f5 ProGuard: require obfuscation be enabled explicitly (#2384) 2022-10-11 15:45:24 +02:00
Igor Demin
4dd1c4a483 Update Compose Compiler version to stable (#2381) 2022-10-10 15:42:01 +03:00
Igor Demin
3996233b03 Allow to use Compose on multiple Kotlin versions (#2366)
JS target supports a lower version (1.7.10), because we have a bug in Koltin 1.7.20

Compose 1.2.0 will support:

1.7.20 and 1.7.10 for Android and Desktop
1.7.10 for JS
We will release the new patchset (1.2.1) with 1.7.2X support for JS later
2022-10-08 15:50:51 +02:00
Alexey Tsvetkov
87df95cbe9 Don't add public.app-category. prefix to appCategory by default (#1887) 2022-10-08 13:09:43 +02:00
Igor Demin
7067f5cffc Remove redirecting to Jetpack Compose in android target in Gradle plugin (#2364)
We redirect to Jetpack Compose overriding in the Gradle Metadata:
https://maven.pkg.jetbrains.space/public/p/compose/dev/org/jetbrains/compose/runtime/runtime/1.2.0-beta03/runtime-1.2.0-beta03.module

So we don't need this functionality in the plugin
2022-10-07 13:47:03 +02:00
Alexey Tsvetkov
e301429247 Replace 'package<BUILD_TYPE>' with 'package<BUILD_TYPE>DistribuionForCurrentOS' (#2353)
ProGuard support has introduced `Release` build type in addition to the default one.
Prior to that there was the `package` task, which did not do anything by itself.

The `package` task existed purely for convenience: instead of running
the `packageMsi` on Windows and the `packageDmg` on macOS, a user could
run the `package` task to package an application into a format suitable for a host OS.

A similar task for the release build type should be called `packageRelease`.
However, this name conflicts with a task created by the `com.android.application`
plugin.

This change deprecates the `package` task and removes the `packageRelease` task.
`packageDistributionForCurrentOS` and `packageReleaseDistributionForCurrentOS` should be used instead.

Resolves #2345
2022-10-04 07:56:46 +02:00
Alexey Tsvetkov
58b0a22fb5 Allow customizing Compose compiler plugin (#2347)
By default, the Compose Multiplatform Gradle plugin
uses `org.jetbrains.compose.compiler:compiler:<COMPOSE_VERSION>`
as a compiler plugin .
However, a new version of Kotlin might be incompatible with
the default version of compiler plugin. Previously, that forced
users to update to a new version of Compose Gradle plugin & Compose libraries
in order to use a new version of Kotlin. Accordingly, Compose framework developers
had to release a new version of all libraries, when a new version of Kotlin is released.

Some time ago the Compose team at Google made it possible to update a compiler plugin
without updating the Gradle plugin and/or all Compose libraries
https://developer.android.com/jetpack/androidx/releases/compose-kotlin

This change allows to specify a custom compiler artifact by using the following DSL:
```
compose {
    kotlinCompilerPlugin.set("<VERSION<")
    // or
    kotlinCompilerPlugin.set("<GROUP_ID>:<ARTIFACT_ID>:<VERSION>")
}
```
2022-10-04 06:02:28 +02:00
Omico
99b7a986e0 gradle-plugin: Let Gradle provide its Kotlin DSL for compose (#2215) 2022-09-22 03:05:13 +02:00
Alexey Tsvetkov
d9de125127 Introduce ProGuard integration for Compose/Desktop packaging (#2313)
Resolves #1174
2022-09-14 18:23:40 +03:00
Oleksandr Karpovich
91a60dc014 remove deprecated compose.web.web-widgets from the source code (#2294)
Co-authored-by: Oleksandr Karpovich <oleksandr.karpovich@jetbrains.com>
2022-09-07 11:05:54 +02:00
dima.avdeev
1f39fa4ba1 Check experimental flags in gradle.properties (#2268) 2022-09-05 18:59:29 +03:00
Igor Demin
33237b662e Use another version of Compose Compiler inside Compose Gradle plugin (#2256)
* Use another version of Compose Compiler inside Compose Gradle plugin

* Update gradle.properties
2022-08-23 01:29:22 +02:00
Oleksandr Karpovich
f59eba3027 w/a: disable tests with gradle 6.4 and 6.7.1
6.4 is not supported by kotlin-gradle-plugin 1.7.0.

6.7.1 is supposed to be the min. supported version by kotlin-gradle-plugin 1.7.0. Despite that, the tests failed.

Tests pass with 7.1.1 and 7.3.3
2022-07-05 13:25:11 +02:00
Philip Wedemann
36b232b653 Gradle Plugin: Fix NPE and use 1.8 by default (#2164) 2022-07-05 13:23:24 +02:00
dima.avdeev
586ec43100 Fix issue 2114. Gradle plugin with xcode 13.4. Add default null values for unused json params. (#2131) 2022-06-20 18:29:56 +03:00
dima.avdeev
85a7e6ced7 compose gradle plugin, lazy initialization of teamId for iOS deploy (#2132) 2022-06-20 13:27:08 +03:00
Thomas Vos
d80ea8ca8c Remove deprecated useIR option (#2076) 2022-05-31 13:51:15 +03:00
Abdelilah El Aissaoui
96f0d98d27 Added animated image component (#2015)
* Added animated image component

* Simplified network request

* Resource load is now done in the IO Dispatchers

* Renamed constant to express better its use

* Refactored animated image component to use the default Image component instead of creating our own component

* Added missing keys

* Created new module resources & adapted AnimatedImage to it
2022-04-29 13:57:15 +03:00
Alexey Tsvetkov
f281b75f77 Update default Kotlin and Compose versions in Gradle tests (#2030) 2022-04-21 19:58:20 +03:00
Alexey Tsvetkov
7d92a265f6 Allow including kotlinx.serialization.* into Gradle plugin (#2020) 2022-04-21 11:25:31 +03:00
Gabriel Souza
1fbbed09bc Excluding multiplatform common sources for not fail in xcode build (#1984) 2022-03-30 15:45:38 +03:00
dima-avdeev-jb
80cfc4c249 iOS gradle: create task to deploy on connected iOS device (#1944) 2022-03-15 17:22:57 +03:00
Alexey Tsvetkov
62a657b6cd Native desktop packaging (#1908)
* Minor: add cleanDirs util

* Generate constant for gradle plugin version

* Unpack icons using task instead of lazy property

Resolves #960

* Introduce K/N Desktop packaging for Mac
2022-03-09 10:07:30 +03:00
dima-avdeev-jb
24526947ad Gradle deploy to iOS simulator (#1899) 2022-03-04 09:42:51 +03:00
Alexey Tsvetkov
1e71abb3c0 Support org.jetbrains.kotlin.js plugin (#1851)
Resolves #1821
2022-02-16 11:51:28 +03:00
Louis CAD
c59aef56a9 Fix wrong word used: transient -> transitive (#1839) 2022-02-14 17:47:48 +03:00
Thomas Vos
aa08279104 Fix TestFlight builds (#1812) 2022-02-10 12:05:26 +03:00