Commit Graph

81 Commits

Author SHA1 Message Date
Ilya Chernikov c112d37ac1 Consolidate resolving in the new lib, deprecate it in script-util
also deprecate Import and CompileOptions annotations, because they
do not seem generic enough. Create specific copie in the main-kts
instead.
2020-05-21 16:49:57 +02:00
Ilya Chernikov 195a90d333 Cleanup warnings in scripting code 2020-04-13 13:49:34 +02:00
Ilya Chernikov d863dc04e6 Move compiler scripting tests to scripting plugin, remove unused funs
also remove some tests that are covered in the scripting-compiler
tests now.
Part of the cleanup to rewrite scripting to the new infrastructure.
2020-04-13 13:49:34 +02:00
Efeturi Money 35d7bb4a26 Add support for @CompilerOptions annotation for supplying compiler
options from scripts.

#KT-34274 fixed
2019-10-23 11:37:28 +03:00
Ilya Chernikov 5b3164ee87 Ignoring resolver tests that failing on TC:
should be rewritten to the new scripting API
Some additional diagnostics improvements are remained for possible
future usage.
2019-07-19 16:37:49 +02:00
Ilya Chernikov 382e55284c Fix legacy definitions error propagation
also fixes script-util test with resolving errors
2019-07-11 15:50:26 +02:00
Ilya Chernikov 9c004c3a52 Refactor scripting compiler plugin - move cli dependent parts out of the -impl jar
The kotlin-scripting-compiler-impl jar is used in the idea plugin and
therefore should not depend on the cli parts of the compiler to avoid
dependency from the plugin to the kotlin-compiler.jar.
Therefore the cli-dependent parts were moved to the scripting plugin
jar, which is used only in cli compiler based environments.
Also implement required abstractions to allow this movement and
drop some redundant dependencies to the cli parts in other projects.
2019-07-11 15:50:26 +02:00
Ilya Chernikov e542c9ea84 Refactor script definitions and resolving/refining infrastructure:
- implement wrappers to wrap old and new API providers and resolvers
- make old API deprecated (with error where possible)
- drop old internal classes related to the old API
- refactor usages accordingly
- fix and add missing features to the scripting API where necessary
2019-06-06 17:21:00 +02:00
nikita.movshin 65244b4bea Update copyright.
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
Update only 2 lines copyright.
2019-04-23 20:09:22 +03:00
Ilya Chernikov a65dafc37d Move scripting support classes to the scripting compiler impl module 2019-04-17 22:03:58 +02:00
Ilya Chernikov 4f135a5fe5 Move REPL implementations to the scripting compiler impl module 2019-04-17 22:03:57 +02:00
Ilya Chernikov ffd1633e3e Write tests for dynamic versions with ivy and maven resolvers
and refactor tests
#KT-27051 fixed
this commit is just a confirmation of the fix: either it worked
from the beginning, or was fixed by some unrelated change
2019-03-20 21:19:24 +01:00
Ilya Chernikov 731df8d3cc Proper handling of the scripting compiler plugin in JSR-223 with daemon 2019-02-10 13:33:21 +01:00
Ilya Chernikov be95acd897 Load scripting plugin explicitly in repl tests and JSR-223 2019-02-10 13:33:21 +01:00
Ilya Chernikov 2f52df0640 Initialize scripting plugin in other tests 2019-02-10 13:31:57 +01:00
Ilya Chernikov 298aaf999e [minor] fix function name typo 2019-01-28 13:15:36 +01:00
Ilya Chernikov 02f2c941c8 Add import support to main-kts, with test 2019-01-10 10:59:32 +01:00
Ilya Chernikov 9e5d04b836 Add generic interfaces to dependency resolvers 2018-12-13 18:00:11 +01:00
Alexander Udalov 009f18f1f4 Split AnalysisFlag values to AnalysisFlags and JvmAnalysisFlags
Declare AnalysisFlags in module 'frontend', and JvmAnalysisFlags in
module 'frontend.java', to avoid leaking Java-related logic to common
compiler code
2018-10-01 13:31:00 +02:00
Ilya Chernikov 7b7f87a3b7 Move ivy resolver to the main-kts to avoid classloading issues...
e.g. when main-kts is loaded in IDEA
#KT-26828 fixed
2018-09-27 12:56:19 +02:00
Ilya Chernikov 43a4b84b44 Make script resolving annotations repeatable, fix multiple repos usage
Also avoid "unknown resolver central" errors on ivy resolving
#KT-27050 fixed
2018-09-26 11:49:45 +02:00
Ilya Chernikov c0f4933356 Make ivy resolver quiet 2018-09-18 18:39:30 +02:00
Ilya Chernikov 73907106e9 Fix script util tests after moving context utils to scripting-jvm 2018-09-16 22:24:59 +02:00
Ilya Chernikov d9760f00f6 Move context classpath utils from script-util to scripting-jvm
since it is the right place to have it in the new structure.
Solves the problem that script-util classes not found then script
definition with context classpath is loaded by the scripting compiler
plugin, since script-util is not packed into embeddable plugin.
The old context utils are deprecated and in fact wrap the new utils.
#KT-26828 fixed (in fact - partially, see another related commit)
2018-09-15 15:43:53 +02:00
Ilya Chernikov 79bad24941 Simple ivy resolver with test 2018-09-07 18:47:18 +02:00
Ilya Chernikov d785b7e4c5 Extract urls from any classloader that has getUrls(): List<URL> method
via reflection, e.g. IDEA platform UrlClassloader. This fix allow
kotlin JSR223 host for IDEA to extract classpath from the environment
properly (with appropriate fix on IDEA side as well).
2018-08-31 15:18:56 +03:00
Jonathan Lermitage 66bb744e3c Update Maven central repository url to latest version 2018-08-17 09:46:07 +02:00
Alexander Udalov 5da8ce844a Minor, move ContentRoot and KotlinSourceRoot to module 'cli'
Also move CONTENT_ROOTS from JVMConfigurationKeys to
CLIConfigurationKeys since it's used on all platforms, not just JVM
2018-08-07 13:38:30 +02:00
Ilya Chernikov f71909ee73 Fix classpath calculation for scripts, e.g. in JSR-223 setting
#KT-25814 fixed
2018-08-01 13:09:05 +02:00
Ilya Chernikov 70eaa0ec75 Cleanup annotations in script-util:
remove unused targets and runtime retention
2018-07-18 13:11:32 +02:00
Ilya Chernikov 15fcee474c Fix script classpasth from environment extraction...
for classes dirs
2018-04-04 16:23:57 +02:00
Ilya Chernikov d50798c4cf Refactor script-util context tools to simplify its usage in the new scripting 2018-04-04 16:23:56 +02:00
Ilya Chernikov 3732422e6a Add example scripting hosts with tests:
the simple scripting host and the one with maven resolving
2018-04-04 16:23:54 +02:00
Ilya Chernikov a5278c2184 Get rid of PathUtil dependency in the script_util
reduces transitive dependencies required for the script_util
2018-02-28 19:29:05 +01:00
Ilya Chernikov a6f8db5d02 Fix script-util tests 2018-01-30 17:06:12 +03:00
Ilya Chernikov 2d8e73f3f6 Make JSR 223 examples compatible with embeddable compiler, strip ...
some dependencies.
Fixes #KT-17561 and related issues
Warning: API changed slightly
2017-12-26 19:27:31 +01:00
Alexander Udalov d4b5032810 Add JDK roots to the beginning of the roots list
This behavior was used until 6a1b6d10d8, where the JDK has
unintentionally started to be added to the end of the list, breaking
code which depended on libraries which bundle something from the JDK

 #KT-21299 Fixed
2017-11-29 11:49:48 +01:00
Nikolay Krasko d2aabe076d Refactoring: extract jar names in PathUtil and use them in artifacts 2017-11-21 01:11:01 +03:00
Pavel V. Talanov cdfdc1d19b Refactor script definitions loading
Make ScriptDefinitionProvider an interface
    and provide different implementation for cli and IDEA
Rework ide extension point to a simpler interface (ScriptDefinitionContributor)
Move template loading logic into a top level function
Allow script definitions to be reloaded in IDE
2017-11-14 16:30:33 +03:00
Alexander Udalov 3ead2e9cd4 Use KotlinCoreEnvironment.createForTests in test code
createForProduction creates and caches JavaCoreApplicationEnvironment
instance, which can alter behavior of subsequent tests
2017-11-03 14:03:02 +01:00
Ilya Chernikov cff6d8cf17 Refactor context classpath discovery, share it to idea's jsr223 host...
...from script-util
fix daemon usage in repls
define compiler classpath for script-util tests explicitly
minor refactorings in the build scripts for better import into idea
2017-10-06 20:12:51 +02:00
Mikhail Zarechenskiy 6a1b6d10d8 Setup JDK roots and initialize JDK_HOME in common core environment
#KT-20167 Fixed
2017-09-18 08:19:41 +03:00
Alexander Udalov 82502e1a8b Fix compilation of kotlin-script-util
Compilation was broken in 46a01ec
2017-07-28 19:26:35 +03:00
Alexander Udalov 2f99f6ad34 Refactor AnalysisFlags and their support in IDE
* Support flags with any value (not just Boolean)
* Support all flags by parsing arguments in KotlinFacetSettings, instead
  of manually listing known flags

 #KT-19210 Fixed
2017-07-26 11:45:24 +03:00
Alexander Udalov 36001ff931 Do not allow to access compiler internals in .kts scripts
Set parent class loader to null explicitly instead of the system class
loader
2017-07-18 20:10:05 +03:00
Alexander Udalov 5bd3716637 Fix compilation of kotlin-maven-plugin and kotlin-script-util 2017-04-28 16:31:11 +03:00
Ilya Chernikov 88652154c9 Port compiler to the script-runtime with script base classes 2017-04-06 10:02:45 +02:00
Alexander Udalov dac9ed4a33 Fix compilation of kotlin-script-util
See 20d5616
2017-03-31 20:14:13 +03:00
Alexander Udalov ccfa42289c Fix compilation of kotlin-script-util
'check' was removed in 579238c3be
2017-03-23 11:46:26 +03:00
Alexander Udalov 332a0f5adc Use 'languageVersionSettings' extension instead of key directly
Also fix compilation of kotlin-script-util
2017-03-16 14:18:01 +03:00