Commit Graph

79 Commits

Author SHA1 Message Date
Vyacheslav Gerasimov 567aabeced Build: Fix kotlin-reflect publication 2020-06-14 20:31:28 +03:00
Vyacheslav Gerasimov f4e8c21309 Build: Introduce new software component for publishing
Some of our published modules don't have javaComponent
2020-06-14 20:31:27 +03:00
Vyacheslav Gerasimov e3f1ddefd0 Build: Add modularJar helper 2020-06-14 20:31:26 +03:00
Vyacheslav Gerasimov d711086be2 Build: Publish Kotlin artifacts with maven-publish plugin 2020-06-14 20:31:25 +03:00
Ilya Gorbunov 01fb200791 Build default jvm core libraries artifacts as modular
#KT-21266
2020-05-18 11:21:12 +03:00
Alexander Udalov 72c52d37ae Add some -X flags for compatibility to kotlin-reflect build
"-Xno-kotlin-nothing-value-exception" is needed to temporarily prevent
the problem happening in the composite build with Kotlin/Native
(ClassNotFoundException from KClassImpl.Data).
"-Xno-optimized-callable-references" is added just in case of any
similar problem.
2020-04-17 18:34:45 +02:00
Ilya Gorbunov 1727fcf1a8 Make some build properties extensions in buildSrc
They are used only in main build's .gradle.kts files, so it is more
flexible to define them as extensions - no need to republish
kotlin-build-gradle-plugin when another such property is to be added.
2020-04-02 05:21:10 +03:00
Vyacheslav Gerasimov 7dc24a13e4 Build: Make ProGuard task cacheable
Exclude jdk files form libraries input. Instead add jdk major version
to inputs. JavaCompile task acts same to ignore fluctuations in JDK
implementations since api should remain same
2020-03-18 22:32:07 +03:00
Vyacheslav Gerasimov 744c4c545e Build: Make DexMethodCount task cacheable, extract print stats to task 2020-03-05 00:47:52 +03:00
Vyacheslav Gerasimov 8e0f403f02 Build: normalize inputs of :kotlin-reflect:stripMetadata as classpath 2020-02-29 16:33:34 +03:00
Vyacheslav Gerasimov 6e2fb72bb6 Build: Make :kotlin-reflect:relocateCoreSources task cacheable 2020-02-29 16:33:34 +03:00
Vyacheslav Gerasimov 0ebc11270b Build: Remove duplicated manifestAttributes call from reflectShadowJar
manifestAttributes call done in the result jar
2020-02-29 16:32:02 +03:00
Yan Zhulanow 73813aef23 Pill: Support all Gradle source sets, not just main/test 2020-02-14 17:35:15 +09:00
Vyacheslav Gerasimov 1f3755248c Build: Make task inputs relative to improve caching 2020-01-24 19:40:00 +03:00
Vyacheslav Gerasimov 8e0dd604af Build: Annotate KotlinModuleShadowTransformer with @CacheableTransformer 2020-01-24 19:40:00 +03:00
Vyacheslav Gerasimov 131765537a Build: Implement preserveFileTimestamps for stripMetadata task 2020-01-24 19:40:00 +03:00
Vyacheslav Gerasimov 317972db2a Build: Make :kotlin-reflect:stripMetadata cacheable 2020-01-24 19:39:59 +03:00
Zac Sweers 482874fdc1 Embed proguard/R8 rules in kotlin-reflect artifact jar
The Android build pipeline can extract embedded proguard configurations
from dependencies and merge them automatically. This adds a conservative
proguard configuration to the kotlin-reflect JVM artifact in support of
that. This focuses mostly on just retaining what's necessary for
kotlin-reflect's own functionality to operate, but could be expanded if
community feedback discovers other good candidate rules.

With this in place - most Android projects using R8 or Proguard should
Just Work™️ with kotlin-reflect.
2020-01-17 20:03:52 +01:00
Alexander Udalov ae395bda09 Do not depend on proguard directly in :kotlin-reflect:modularJar
This is useful if proguard is disabled with
-Pkotlin.build.proguard=false.
2020-01-17 19:58:27 +01:00
Vyacheslav Gerasimov aa05bcc16b Build: Fix usages of this project unavailable in gradle 6.0 2019-11-27 21:26:33 +03:00
Vyacheslav Gerasimov 1cdc68901a Build: Use kotlinx-metadata-jvm from jcenter instead of bintray 2019-08-22 20:39:28 +03:00
Vyacheslav Gerasimov 669b6d164c Build: Use cache redirector for buildscript block of :kotlin-reflect 2019-08-22 20:39:28 +03:00
Ilya Chernikov 2ed8fa7624 Convert main task creating helper to lazy API, refactor accordingly 2019-08-21 20:20:08 +02:00
Vyacheslav Gerasimov 9b32670738 Build: Use stripMetadata task for result jar when relocation is enabled
to cleanup invalid metadata left after relocation
2019-07-11 20:07:14 +03:00
Vyacheslav Gerasimov 4531d2a7b4 Build: restore service files relocation for kotlin-reflect 2019-06-27 19:51:58 +03:00
Sergey Rostov 6647d8fd93 Build: remove mergeServiceFiles from reflectShadowJar 2019-06-27 17:56:52 +03:00
Vyacheslav Gerasimov 2d6a3cb2c8 Build: Introduce flag for disabling jar post processing
proguard, relocation, etc.
2019-06-27 17:56:52 +03:00
Vyacheslav Gerasimov db3b01d2d4 Build: Centralize compiler dist build logic in :kotlin-compiler project 2019-06-27 17:56:48 +03:00
Nikolay Krasko aa079376e7 Fix signing artifacts (KT-32192)
Broken in f1e3e26e6cd6e38b473ffe1a23b19b68ebb2d11f.

----
> Task :kotlin-reflect:signArchives FAILED
Build time for tasks:
Compiling kotlin: 1.44s (12.33% of total time)
Processing jars: 4.28s (36.75% of total time)
Uncategorized: 5.39s (46.26% of total time)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':kotlin-reflect:signArchives'.
> Duplicate key Signature kotlin-reflect:jar.asc:asc:
---

 #KT-32192 Fixed
2019-06-25 11:46:17 +03:00
Vyacheslav Gerasimov 2769dc8359 Build: Improve sourcesJar helper
- Add sources from embedded projects
 - Add artifact to sources configuration
 - Use register instead of create

 #KT-30237 Fixed
2019-06-07 17:37:46 +03:00
Vyacheslav Gerasimov d765bebcfc Build: Import embedded configuration as runtime in JPS build
This makes Idea import all embedded modules as transitive dependencies

 #KT-29548
2019-05-14 18:07:17 +03:00
Vyacheslav Gerasimov 5782267d26 Build: Fix import of kotlin-reflect in JPS build
#KT-29548 Fixed
2019-05-14 18:07:17 +03:00
Vyacheslav Gerasimov b9fe6875e3 Build: Minor cleanup kotlin-reflect 2019-05-14 18:07:16 +03:00
Vyacheslav Gerasimov c672300da1 Build: Use embedded configuration in kotlin-reflect 2019-05-14 18:07:16 +03:00
Alexander Udalov a9de157fd4 Exclude .kotlin_builtins files when proguarding kotlin-reflect.jar
Even though kotlin-annotations-jvm.jar itself doesn't contain those
files, ProGuard pulls them from the project dependency of
:kotlin-annotations-jvm on :core:builtins. They are already present in
kotlin-stdlib.jar and are thus not needed in kotlin-reflect.jar
2019-03-29 09:45:44 +01:00
Sergey Rostov fb3f28974e Build: support local.properties for JPS build. Apply JPS related tweaks only inside IDEA import. 2019-03-28 10:06:16 +03:00
Stanislav Erokhin f7702d3e43 Create new core module: type-system 2019-03-04 17:10:45 +03:00
Vyacheslav Gerasimov d32f6fb382 Build: Fix compatibility with shadow plugin
Apply java-base plugin since shadow task requires sourcesets
2019-02-18 19:58:56 +03:00
Sergey Rostov f35185b261 Build: remove explicit dependencies to org.jetbrains.annotations 2019-01-28 13:43:08 +03:00
Sergey Rostov 12cfd6396d JPS build flag: exclude java9 when jps build enabled 2019-01-28 13:43:07 +03:00
Vyacheslav Gerasimov f58acbeef5 Build: implement useBootstrapStdlib flag
Excludes stdlib projects from build and uses bootstrap stdlib artifacts

 #KT-29205
2019-01-21 21:09:40 +03:00
Sergey Rostov 883970fadb Add explicit dependencies to nullable annotations 2018-12-26 09:07:06 +03:00
Sergey Rostov 487c57e2e0 Move resources, kotlin-reflect.jar: remove manually included META-INF/services/*
Now it already included. Manually including causes duplicated contents
in resulting files, for example:

1	   kotlin.reflect.jvm.internal.impl.load.java.FieldOverridabilityCondition
2	   kotlin.reflect.jvm.internal.impl.load.java.ErasedOverridabilityCondition
3	   kotlin.reflect.jvm.internal.impl.load.java.JavaIncompatibilityRulesOverridabilityCondition
4	+  kotlin.reflect.jvm.internal.impl.load.java.FieldOverridabilityCondition
5	+  kotlin.reflect.jvm.internal.impl.load.java.ErasedOverridabilityCondition
6	+  kotlin.reflect.jvm.internal.impl.load.java.JavaIncompatibilityRulesOverridabilityCondition

Removing this line fixes that.
2018-11-30 15:01:02 +03:00
Ilya Gorbunov e49789f819 Build java9 modular artifacts under 'modular' classifier
Provide additional modular artifacts as a workaround for KT-21266

Update module-info declarations:
  - add new packages
  - add exports and opens for internal PlatformImplementations
  - remove exports of kotlin.coroutines.experimental.*

#KT-27919 Fixed
2018-11-01 02:27:49 +03:00
Ilya Gorbunov 86ba5ebf29 Mix kotlin-annotations-jvm with kotlin-reflect into proguard
So it can strip these annotations from the resulting jar.

#KT-26929 Fixed
2018-09-19 12:40:47 +03:00
Ilya Gorbunov a18770fbbb Remove projectDist dependency helper usages
Use default configuration dependencies instead of projectDist ones.
2018-09-12 06:05:05 +03:00
Ilya Gorbunov 03340d770b Replace remaining distJar dependencies with default configuration dependencies 2018-09-12 06:05:05 +03:00
Alexander Udalov e41e28271b Use kotlinx-metadata-jvm of version 0.0.4 in kotlin-reflect build script
To prevent various problems with non-shaded artifact (shading was added
in 0.0.3)
2018-08-21 17:12:02 +02:00
Ilya Gorbunov 2a598e0ac4 Replace ReadOnly/Mutable usages in the compiler
Replace ones from org.jetbrains.kotlin package with new annotations from kotlin.annotations.jvm.
No need to copy them to compile kotlin-reflect anymore.
Then simplify reflect project more: no sources — no need to pack its direct output.
2018-08-03 09:37:38 +03:00
Alexander Udalov 1f4dfbf5f3 Fix compilation of Java 9 sources for kotlin-reflect-api
Do not pass the jars for modules such as descriptors, descriptors.jvm,
etc to `--module-path` because javac assumes that these are separate
modules (even though they're listed later as parts of this module in
`--patch-module), and prohibits to have split packages and foreign
service implementations among them
2018-07-13 18:45:09 +02:00