Commit Graph

3626 Commits

Author SHA1 Message Date
Sergey Igushkin c4d9c4cee4 Group associated compilations into modules with a single module name
As associated compilations will see internals of each other, they now
need to share the module name for the compiler to be able to correctly
generate calls to the internals.

Move `moduleName` to `KotlinCompilation`.

Group associate compilations into modules in a DSU-like way, use a
single module name for all of the compilations grouped into a module.
2019-09-25 15:46:04 +03:00
Sergey Igushkin 94fd5c2884 Implement source sets visibility inference via associate compilations
Add non-public API for the IDE to query additional visible source sets
for each source set.
Implement visibility inference via associate compilation links.
Implement visibility requirements for source sets and requirements
satisfaction checks in Gradle build.
2019-09-25 15:46:04 +03:00
Sergey Igushkin 8c1c687e92 Implement associate compilations, KT-34009
Partial implementation of the associate compilations proposal. A
compilation can now contain links to other compilation that it compiles
against. This links will replace ad-hoc inter-compilation dependencies.

Issue #KT-34009 Fixed
2019-09-25 15:46:04 +03:00
Sergey Igushkin bb6f406be4 Partial cleanup & refactoring of the Android plugin
The `KotlinAndroidPlugin` used to support two different sets of APIs of
the Android Gradle plugin and used `AbstractAndroidProjectHandler` to
wrap those APIs. Now that there's only one implementation, it
doesn't need the generic `V` (variant data), and some cleanup is needed.
2019-09-25 15:46:03 +03:00
Sergey Igushkin 0e59553d12 Add Kotlin & Java destination dirs as output of Android compilation
The compilation outputs of Android compilations accidentally were left
empty. The `destinationDir`s of the Kotlin & Java tasks should be
registered in the `output.classesDirs`.
2019-09-25 15:46:03 +03:00
Sergey Igushkin 9836a1ca4a Make compilationsBySourceSets safe to use during evaluation
This function used to only calculate the mapping once and store it for
the project, so it was unsafe to use early. Fix that by evaluating the
value each time and then freezing it at the point of either task graph
being ready, or any task being executed.

Also, store the map in the project's `ext` rather than in a static weak
hash map, which is safer wrt memory leaks.
2019-09-25 15:46:03 +03:00
Sergey Igushkin 5dd4e0ed42 Track the compilation outputs as inputs of Gradle JS test tasks, KT-33313
Issue #KT-33313 Fixed
2019-09-25 15:46:02 +03:00
Sergey Igushkin 3011a3cf81 Create objects via Gradle ObjectFactory to allow access from Groovy 2019-09-25 15:46:02 +03:00
Sergey Igushkin fe50029beb Adjust task output detection for Gradle 4.9 2019-09-25 15:46:02 +03:00
Sergey Igushkin 43c3122a13 Drop Gradle versions older than 4.9
* Replace `TaskHolder` with `TaskProvider`, remove `TaskHolder`
* Migrate Gradle integration tests to Gradle 4.9+
2019-09-25 15:46:01 +03:00
Sergey Igushkin 9f0c5675bd Introduce execution & test run API, KT-32679
* KotlinExecution
* KotlinExecutionSource
* KotlinTestRun
* Aggregating executions and execution sources
* KotlinTargetWithTests

* Add a `testableTargets` extension
* Make some Kotlin/Native targets testable (this requires
  having a separate preset type for them)
* Implement test runs encapsulating the tests for all
  existing testable targets by refactoring their
  TargetConfigurator classes

Issue #KT-32679 Fixed
2019-09-25 15:46:01 +03:00
Ivan Gavrilovic f89885224e Add tests for running incremental KAPT on JDK9
Add test for aggregating incremental annotation processors and JDK9.
This makes sure the implementation is not using any types that have
been removed in JDK 9.
2019-09-25 19:21:10 +09:00
LepilkinaElena 594f4a6f56 New flag for KotlinNativeCompilation to enable endorsed libraries (#2618) 2019-09-25 10:28:09 +03:00
Ilya Goncharov bfc698a521 Add comment for log-reporter and its necessity 2019-09-24 14:36:11 +03:00
Ilya Goncharov 09e2ebe60a Both js targets use one TC service message classes 2019-09-24 14:36:11 +03:00
Ilya Goncharov 7d4b43f819 Remove annoying spaces in karma-teamcity-reporter 2019-09-24 14:36:10 +03:00
Ilya Goncharov b4e3cf1d7a Move teamcity reporting only to nodejs 2019-09-24 14:36:10 +03:00
Ilya Goncharov 46e82468e4 Provide logging through kotlin-test=js-runner 2019-09-24 14:36:10 +03:00
Ilya Goncharov f0e72c4d71 Remove mangling for kotlin-test-js-runner 2019-09-24 14:36:10 +03:00
Ilya Goncharov e59d1a0ef1 Use terser instead of uglify 2019-09-24 14:36:10 +03:00
Ivan Gavrilovic 6e7f046471 Fix gradle integeration tests
Fix test failure on Windows, where backslash was not escaped
in a build file. Also, remove obsolete test for Gradle 4.2,
because 4.3 is the minimum supported version.
2019-09-23 17:32:36 +09:00
Ilya Matveev 5c904250be Gradle, native: Update a K/N version in tests
Earlier, K/N 1.1 was used when testing the kotlin.native.version
property. But this version doesn't support the -no-endorsed-libs
flag add recently. This patch updates K/N version in tests.
2019-09-20 16:54:30 +07:00
Ilya Goncharov 31aa4e4738 Rename kotlin-test-nodejs-runner to kotlin-test-js-runner 2019-09-20 10:56:18 +03:00
Ilya Goncharov 10c36ae5c5 Change naming from commin cli.ts to concrete platform nodejs.ts 2019-09-20 10:56:17 +03:00
Ilya Goncharov c2b5df83f6 Add filtering feature to karma testing
- Now karma use generated adapter.js as input, in which right runner and
also all real input files are required

#KT-32216 fixed
2019-09-20 10:56:15 +03:00
Ilya Goncharov 09a602d8ad Move common logic of js test running on upper level (js) 2019-09-20 10:49:57 +03:00
Ilya Goncharov e750bd302d Add karma input for kotlin-test-nodejs-runner
- To set custom adapter for kotlin-test, it is necessary to inject adapting
code to webpack's input, so then it is executed inside browser and set
custom adapter
This code will be injected to webpack's input
2019-09-20 10:49:56 +03:00
Ilya Goncharov e242856124 Enable cli description to have free args title 2019-09-20 10:49:56 +03:00
Ilya Goncharov 80ea91f574 Extract Adapter getting to common place 2019-09-20 10:49:56 +03:00
Ilya Goncharov b44249255c Extract default cli parser to common place 2019-09-20 10:49:56 +03:00
Ilya Goncharov f0af4756a9 Fix accuracy for regex filtering for nodejs testing 2019-09-20 10:49:56 +03:00
Ilya Goncharov e2aecee925 Fix exact test filtering for nodejs 2019-09-20 10:49:56 +03:00
Ilya Matveev 1b64583855 Gradle, native: Embed bitcode for watchOS and tvOS 2019-09-20 12:52:48 +07:00
Ivan Gavrilovic 58efa34a33 KT-31291: KAPT - make sure ASM version is not inlined
Switch to Java reflection when getting the ASM version used
to analyze classes. Using Kotlin reflection resulted in the constant
being inlined.

Fixes KT-31291
Fixes KT-33493
2019-09-20 00:04:27 +09:00
Ivan Gavrilovic 434fb75eb7 Incremental KAPT: when unable to process incremental changes, run non-incrementally
When analyzing incremental changes in the KAPT task, incremental compilation
can handle directory changes, Java source file changes, jar/.class file changes,
and changes to the ABI structure of the classpath. Anything else should cause
a full recompilation.

Test: KaptIncrementalWithIsolatingApt.testNonIncrementalWithUnrecognizedInputs
2019-09-20 00:04:27 +09:00
Ilya Goncharov b59fba6707 Fix mocha run
#KT-33579 fixed
2019-09-19 15:42:49 +03:00
Ilya Matveev d3f1cf1cdd Gradle, native: Don't ignore exit codes of K/N tests
Issue #KT-32872 fixed
2019-09-16 18:28:03 +07:00
Ilya Goncharov acc86be043 Extend karma-teamcity-reporter to log browser's output
#KT-32073 fixed
#KT-32281 fixed
2019-09-16 12:33:45 +03:00
Ilya Goncharov 8fbdb15626 Show suppressed output in case of karma launch failed 2019-09-16 12:31:59 +03:00
Ilya Goncharov 425582bb4b Use only custom karma reporter
- Ideally these changes should be on karma-teamcity-reporter
2019-09-16 12:31:59 +03:00
Ilya Goncharov ddbae98841 Remove redundant marker of browser log starting 2019-09-16 12:31:58 +03:00
Ilya Goncharov 355f847ee0 Add parse of karma log to find browser's messages
- Log browser's message respects their log level
2019-09-16 12:31:58 +03:00
Ilya Goncharov 8c46fab6d8 Add own reporter that reports only browser log in specific format 2019-09-16 12:31:57 +03:00
Ilya Goncharov 9bb5022eb4 Move nested classes 2019-09-16 12:31:57 +03:00
Ilya Goncharov 6277267563 Make KarmaConfig as data class 2019-09-16 12:31:57 +03:00
Ilya Goncharov 8f7c5c13f8 Parse karma problem to fail task
#KT-31663 fixed
2019-09-16 12:31:55 +03:00
Ilya Goncharov 3d67b952f8 Parse browser output to log 2019-09-16 12:25:55 +03:00
LepilkinaElena 7cae9214d7 Disable endorsed libraries in plugin (#2536) 2019-09-16 09:43:22 +03:00
Ilya Matveev 45a413c892 Gradle, native: Minor fixes
Fix ReplaceWith for compilation.extraOpts
Simplify languageSettings access in compile tasks
Use checkedReplace in binary integration tests
2019-09-16 12:45:06 +07:00
Ilya Matveev 60ae03f08b Gradle, native: Don't use deprecated DefaultTask.newOutputFile()
This method is planned to be removed in Gradle 6.0, so we avoid
using it.
2019-09-16 12:45:05 +07:00