Commit Graph

140 Commits

Author SHA1 Message Date
Yahor Berdnikau 6b19b8b9d0 [Repo] Don't use kotlinOptions in repo build scripts
^KT-63419 In Progress
2024-02-22 14:48:10 +00:00
cristiangarcia cb0d78d443 singleOutputFile() method used Task.getProject() and that's not allowed with CC
Required for KTI-1553
2024-02-09 21:35:03 +00:00
Alexander.Likhachev a19bd2ed2e [Build] Migrate most of the build logic from Project.buildDir usage
It's going to be deprecated in Gradle 8.3

There's currently no way to pass a `org.gradle.api.provider.Provider` to the JavaExec.systemProperty or Test.systemProperty. There's a workaround using `org.gradle.process.CommandLineArgumentProvider`, but I intentionally don't rework these calls as Gradle is going to allow passing providers to configure system properties: https://github.com/gradle/gradle/issues/12247#issuecomment-1568427242
^KTI-1473 In Progress
2023-12-07 18:31:06 +00:00
Alexander Udalov b63a780e15 Build: update kotlinx-metadata-jvm to 0.7.0 2023-11-24 14:03:21 +00:00
Yahor Berdnikau 380062c511 [repo] Update the shadow version to 8.1.1 release
https://github.com/johnrengelman/shadow/releases/tag/8.1.1
2023-08-09 08:36:46 +00:00
Ilya Gorbunov 865f392681 [Docs] Use absolute urls in links, new Dokka doesn't support relative 2023-07-26 10:15:45 +00:00
Yahor Berdnikau 7bfe59253f [repo] Migrate 'manifestAttributes()' into buildSrc 2023-07-04 19:26:38 +00:00
Yahor Berdnikau db1086f005 [repo] Migrate 'configureFrontendIr()' into buildSrc 2023-07-04 19:26:38 +00:00
Yahor Berdnikau 5de2b5aeb4 [repo] Migrate Groovy build scripts to use 'kotlinStdlib()' directly from buildSrc 2023-07-04 19:26:38 +00:00
cristiangarcia 650b00e1b2 Improve DexMethodCount task
Use lazy api to set the file and avoid configuring Jar tasks
2023-06-28 07:48:20 +00:00
Alexander Udalov ecc1f9fb0b Update to kotlinx-metadata-jvm 0.6.2
Migrate to the new API in kotlin-reflect build script, remove obsolete
workarounds.
2023-06-27 14:32:15 +00:00
Alexander Udalov c66bc36382 Build: fix some warnings in buildSrc and build.gradle.kts 2023-06-26 15:42:21 +00:00
cristiangarcia 46d113605b Adopt configuration-avoidance where possible
Before this change `./gradlew help` (with native enabled)
Created immediately: 1322
Created during configuration: 1541

after this change:
Created immediately: 596
Created during configuration: 1509

To know more about configuration avoidance: https://docs.gradle.org/current/userguide/task_configuration_avoidance.html
2023-06-06 14:27:42 +00:00
Vyacheslav Gerasimov 76c54a8ff3 Build: Fix usages of apis deprecated in Gradle 8 2023-03-20 19:45:39 +00:00
Ilya Gorbunov ba6732ac17 Render kotlin-reflect library documentation in a separate module 2023-02-22 23:52:42 +00:00
Dmitriy Novozhilov 20610a7c89 [Build] Bump kotlinx.metadata version to 0.6.0 2023-02-18 13:26:51 +00:00
Mikhail Glukhikh 5af37e4647 kotlin-reflect: split K2/K1 branches in KotlinModuleShadowTransformer 2023-01-17 13:46:52 +00:00
Mikhail Glukhikh 13502abab9 Fix FIR bootstrap in version 2.0 2023-01-16 18:16:07 +01:00
Nikolay Krasko 6afceb1e84 Remove more usages for embedded with isTransitive = true
It's a refactoring because the list of dependencies shouldn't change

Follow up for KTI-942
2022-10-12 13:44:30 +00:00
Dmitriy Novozhilov 9b63dde1c3 Add error-level OptIn on safeAs, cast and assertedCast functions in addToStdlib
Usage of this function is unsafe because it does not have native compiler
  support. This means that compiler won't report UNCHECKED_CAST,
  CAST_NEVER_SUCCEED or similar diagnostics in case of error cast
  (which can happen immediately or after some refactoring of class hierarchy)
2022-10-06 06:57:07 +00:00
Nikolay Krasko 54c7efe1cb Refactorings for toolchains 2022-09-27 12:49:55 +00:00
Abduqodiri Qurbonzoda f3e8816dc3 Do not generate JVM 1.8+ annotation targets in stdlib, -jdk7, -jdk8, reflect
See #KT-53712
2022-09-02 14:59:24 +00:00
Abduqodiri Qurbonzoda eb3bbc3265 Remove "-Xsuppress-deprecated-jvm-target-warning" compiler argument 2022-08-13 01:48:23 +03:00
Vsevolod Tolstopyatov 14b13a2f17 [kotlin.reflect] Introduce ClassValue-based cache for KClassImpl
* Replace pcollections with ClassValue/ConcurrentHashMap-based caches
* Do not store weak references, instead cache strong references and count on ClassValue to unload the corresponding classloader if necessary
* ConcurrentHashMap does not rely on WeakReference as it's only selected on Android where classloader leaks don't exist
* Update reflect/scripting JDK requirement to Java 8 in order to proceed

#KT-53454
#KT-50705


Merge-request: KT-MR-6788
Merged-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
2022-08-05 15:35:34 +00:00
Ilya Gorbunov 0546b0902c Fix line endings ruined after applying line filter
Line filtering causes output file have platform-specific line endings.
Apply another filter to fix them to LFs.
2022-07-01 13:16:11 +00:00
Ilya Gorbunov d825af7a22 Switch language version in Kotlin project to 1.8
Use kotlinx-metadata-jvm:0.5.0 that supports reading 1.8.0 kotlin metadata version
2022-07-01 13:04:03 +00:00
Yahor Berdnikau af6f17c243 Unify kotlinCompilerClasspath for all projects
This will prevent spawning second Kotlin daemon during compilation
except 'buildSrc' compilation. Original change was introduced in
2e515f3945 commit.
2022-05-24 07:58:38 +00:00
Dmitriy Novozhilov 993021a71d [Build] Use 1.8 target version instead of 1.6 while using JPS build 2022-05-19 07:14:21 +00:00
Alexander Udalov 2e515f3945 Prohibit JVM target 1.6
But still compile stdlib, reflect, kotlin.test and scripting runtimes
with JVM target 1.6 to simplify migration from Kotlin 1.6 to 1.7.

 #KT-45165 Fixed
2022-04-19 22:54:40 +02:00
Ilya Gorbunov dea149ab47 Advance Kotlin version used in build to 1.7
Also update kotlinx-metadata-jvm used in kotlin-reflect build to 0.4.1
in order to support reading Kotlin 1.7 metadata version.
2022-03-05 22:15:59 +03:00
Ilya Gorbunov 2954769296 KT-50059 Stop publishing artifacts with 'modular' classifier 2021-12-29 17:43:56 +00:00
Nikolay Krasko 85521f01f8 Update shadow plugin 6.1.0 -> 7.1.1
Version 7.1.1 is absent in jcenter, so additional repository was added
in some modules.

Leave old version in NewMultiplatformIT.kt because of
`This version of Shadow supports Gradle 7.0+ only. Please upgrade.` error.

^KTI-733 Fixed
2021-12-20 21:39:00 +03:00
Nikolay Krasko 36c4938172 Add version to kotlin-reflect-stripped jar 2021-10-27 11:04:41 +03:00
Nikolay Krasko d348efa4c1 Do not pack proguard and stripped jars for kotlin-reflect into compiler zip
kotlin-reflect-proguard.jar has different timestamps and shows
difference on each build for the same sources.

The problem was introduced after migrating to Gradle 7.1 where
`libsDir` parameter was removed (https://docs.gradle.org/current/userguide/upgrading_version_6.html#removal_of_basepluginconvention_libsdir_and_basepluginconvention_distsdir).
After that the same variable started to be resolved to `dist` directory.
So this commit reverts the old behaviour.

^KTI-672 Fixed
2021-10-27 11:04:40 +03:00
Alexander Likhachev 2f230833ac [Build] Create configuration in :kotlin-reflect-api to patch Java module
`compileOnly` configuration is unresolvable, and it's more preferable to create new configuration that extends from it rather than making it resolvable
2021-09-29 16:34:10 +00:00
Vyacheslav Gerasimov d200edbb89 Build: Specify duplicatesStrategy for :kotlin-reflect:modularJar
As a workaround for #KTI-653
2021-09-27 13:16:29 +03:00
Vyacheslav Gerasimov f91d6958a8 Build: Rework runtimeJar helper and drop redundant configuration
#KTI-559
2021-09-26 20:10:29 +03:00
Vyacheslav Gerasimov ab146bd6d4 Build: Fix deprecated Gradle configurations usages
for migration to Gradle 7+ #KTI-559
2021-09-26 18:28:44 +03:00
Dmitriy Novozhilov 0923d39215 [Build] Setup useFirForLibraries flag 2021-09-20 14:18:18 +03:00
Mikhail Glukhikh ffbd574a08 Use -opt-in instead of -Xopt-in in comments and scripts 2021-09-08 23:43:55 +03:00
Alexander Udalov 0925e1b497 Enable JVM IR for stdlib/reflect/test libraries
Changes in Gradle integration tests are needed because:
- in new-mpp-android, kotlin-stdlib-jdk8 is used, and JVM IR generates
  JDK 8-specific bytecode (invokedynamic). D8 needs to be configured to
  desugar it with source/target versions set to 1.8, otherwise it
  reports an error.
- in AndroidExtensionsManyVariants and AndroidIcepickProject, D8 fails
  with assertions enabled if AGP < 4.0.0 is used because of
  https://issuetracker.google.com/issues/148661132. The tests which use
  old AGP versions are probably not relevant anymore anyway.

Changes in kotlin-stdlib-runtime-merged.txt are caused by a slightly
different generation scheme of collection subclasses in JVM IR, and are
harmless.

(Previous attempt was at 15e978dbd311c2ba78ec32b394c21acde9811ccb.)
2021-08-05 12:36:35 +02:00
Alexander Udalov 0a9498f7e2 Build: suppress deprecated JVM target warning globally
There seems to be no point in configuring the compiler argument per
project. This argument will be deleted soon anyway, when we remove
support for JDK 1.6 & 1.7.

Also remove `disableDeprecatedJvmTargetWarning`. It didn't have any
effect in all modules where it was applied because these modules
reassign `freeCompilerArgs` anyway, with
`-Xsuppress-deprecated-jvm-target-warning` in it.
2021-07-27 13:35:39 +02:00
Alexander Udalov 91c39ed01c Build: remove obsolete compiler arguments
These compiler arguments enable features which are enabled by default in
the current Kotlin anyway.

The only exception is in :compiler:cli which uses an old language
version.
2021-07-27 13:35:38 +02:00
Mikhael Bogdanov 03ccbf1b17 Upgrade kotlinx-metadata-jvm and binary-compatibility-validator versions 2021-07-19 13:49:05 +00:00
Yahor Berdnikau 1bd0607b53 Fix toolchain jdk override was not working for all modules.
Now it also considers the case when separate tasks toolchain
are configured or module only has java toolchain.

^KT-46972 Fixed
2021-07-05 21:15:04 +02:00
Yahor Berdnikau 7789054547 Migrate repo to use JVM toolchains Gradle feature.
^KT-46972 Fixed
2021-07-05 14:11:12 +00:00
Alexander Likhachev 6bd44df861 [Build] Fix configuration cache issues (part 6)
Make DexMethodCountStats task class, tasks :examples:kotlin-jsr223-daemon-local-eval-example:test,:idea:idea-fir:test, :idea:idea-fir-performance-tests:test, :idea:idea-frontend-fir:test, :idea:idea-frontend-fir:idea-fir-low-level-api:test, :kotlin-compiler-client-embeddable:test, :kotlin-compiler-embeddable:test, :kotlin-stdlib-js-ir:compileTestKotlinJs, :plugins:android-extensions-compiler:test, :plugins:parcelize:parcelize-compiler:test, :compiler:test compatible with configuration cache
Relates to #KT-44611
2021-03-11 14:12:36 +03:00
Alexander Likhachev 5f10c98a38 [Build] Fix configuration cache issues (part 3)
* Make IntelliJInstrumentCodeTask compatible with configuration cache
* Make CoreXmlShadingTransformer compatible with configuration cache
* Make :kotlin-reflect:relocateCoreSources compatible with configuration cache
* Copy some properties to not capture it's owning object into lambda to support configuration cache
Relates to #KT-44611
2021-03-11 14:12:34 +03:00
Alexander Udalov 8c95b78346 Update JVM metadata version to 1.5.0
Improve the test which checks that we use correct metadata version if
`-language-version` is passed by checking all supported language
versions.

The change in libraries/reflect/build.gradle.kts is needed because
kotlinx-metadata-jvm of version 0.1.0 is based on pre-1.4 Kotlin, which
doesn't support the new module file metadata generated with metadata
version 1.4 and later, and module files need to be readable there to be
able to transform them for the shadow plugin.

Similarly override dependency on kotlinx-metadata-jvm in the
binary-compatibility-validator module.
2021-02-18 12:42:23 +01:00
Alexander Udalov e0b6d4d917 Add -Xsuppress-deprecated-jvm-target-warning to modules compiled with 1.6
Currently this leads to an unknown argument warning, but it'll be
removed automatically on the next bootstrap.
2021-02-03 12:51:39 +01:00