206 Commits

Author SHA1 Message Date
Oleksandr Karpovich
cf7bdaa352 Use compose compiler 1.4.5 with kotlin 1.8.20 (#3031) 2023-04-11 14:34:44 +02:00
Oleksandr Karpovich
84d91b1e81 Improve a message about incompatible kotlin version (#3032)
* Improve a message about incompatible kotlin version

Add Compose Multiplatform to the message

* Update gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/ComposeCompilerCompatibility.kt

Co-authored-by: Igor Demin <igordmn@users.noreply.github.com>

---------

Co-authored-by: Igor Demin <igordmn@users.noreply.github.com>
2023-04-11 14:34:33 +02:00
Sebastian
532bb3d6d8 Fix references to outdated 'nativeExecutables' in error messages (#3019)
In 991b7ff6a7 'nativeExecutables' was
renamed to 'nativeDistributions', however a later commit added error
messages that still reference the old DSL names.
2023-04-11 11:55:50 +02:00
Alexey Tsvetkov
9540cdcf79 Require JDK 17 for packaging (#3027)
Previously Compose Multiplatform Gradle plugin required
JDK 15+ for distribution packaging. However, fixing #2867 required
always passing --mac-entitlements to jpackage, which is
only available with JDK 17+.
2023-04-11 11:43:29 +02:00
Igor Demin
9fc6763b79 Update ComposeCompilerCompatibility.kt (#3006)
* Update ComposeCompilerCompatibility.kt

* compose.tests.compiler.version=1.4.5-rc03
2023-04-07 11:56:15 +02:00
Igor Demin
1fbeced85b Support Kotlin 1.8.20 (#3000)
* Support Kotlin 1.8.20

* Use Compiler 1.4.5-rc01 for Gradle tests

* Update ComposeCompilerCompatibility.kt
2023-04-06 22:06:02 +02:00
Igor Demin
59eda00380 Rename Web to HTML (#2997)
1. Rename "compose.web" to "compose.html" in Gradle DSL
2. Rename maven artifacts (with backward compatible "relocation" artifact)
3. Rename "web" folder to "html"

Will do in support/1.4.0 branch
1. Move examples/web-* to examples/html/*
2. Rename Tutorials/Web to Tutorials/HTML
3. Rename "Compose for Web" to "Compose HTML Library" in the tutorials
2023-04-06 18:07:50 +02:00
Alexey Tsvetkov
32ace9173e Provide some entitlements on macOS by default (#2974)
Also, this change configures entitlements for
local ad hoc signs on Apple Silicon

Fixes #2867
Partial fix of #2887
2023-04-04 17:09:04 +02:00
Alexey Tsvetkov
ddc300f0fe Fix passing relative path main jar to jpackage 2023-04-04 14:27:59 +02:00
mcpiroman
8d78c4ac67 Provide relative path to jpackage --main-jar 2023-04-04 14:27:49 +02:00
Alexey Tsvetkov
3483feef2a Unzip wix to build directory (#2838)
Resolves #2804
2023-04-04 13:18:27 +02:00
Oleksandr Karpovich
0b429b6ac9 Update all versions for 1.3.1 + update Changelog (#2856)
* Add changes for 1.3.1 + update Changelog

Versions:
compose 1.3.1
kotlin 1.8.10
compiler: 1.4.2

* revert version update in experimental examples

* Update CHANGELOG.md
2023-03-10 09:53:41 +01:00
Nikita Lipsky
2cd92eed5c Add resources library to dependencies declared by compose gradle plugin (#2793)
* Add resources library to compose dependencies declared by compose gradle plugin

* Move resources component to CommonComponentsDependencies
2023-02-24 14:37:23 +02:00
Igor Demin
3b81485bcc Remove experimental status of Material 3 (#2740)
It is already stable and reached 1.0.0 in Compose Multiplatform 1.3
2023-02-15 16:12:17 +01:00
Oleksandr Karpovich
e9789ba364 Fix ComposeExtension.kotlinCompilerPluginArgs for non-jvm compilations (#2716) 2023-02-08 10:20:10 +01:00
Alexey Tsvetkov
8f3578bdca Fix gradle tests (#2708)
* Add docker file for Gradle tests on TeamCity

* Remove configuring JDK for tests

* Update compose & kotlin compiler in testAndroidxCompiler
2023-02-06 20:25:24 +01:00
Oleksandr Karpovich
bc6d42ef44 Update versions: compose - 1.3.0 and kotlin - 1.8.0 (#2651)
* Update versions in examples

* Add more scripts to validate example on android and k/js

* Add validateExamplesIos.sh

* Update CHANGELOG.md for 1.3.0

* check examples with 1.3.0-rc06

* Update the versions: compose-multiplatform - 1.3.0, kotlin - 1.8.0

* Update ComposeCompilerCompatibility (1.4.0)

* Update web/yarn.lock
2023-01-30 21:02:23 +01:00
Alexey Tsvetkov
e2aba37e62 Use global directory to download wix toolset (#2639)
* Use global directory to download wix toolset

Resolves #2592
2023-01-16 18:50:10 +01:00
Alexey Tsvetkov
c3726347ef Test with Gradle 8-RC-1 (#2621)
* Test with Gradle 8-RC-1

* Fix Gradle tests for 8.0-rc-1
2023-01-16 14:41:44 +01:00
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