Commit Graph

58 Commits

Author SHA1 Message Date
Ilya Chernikov
0b9770f8d1 Refactor scripting - rename env vars to provided properties everywhere 2018-12-13 18:00:12 +01:00
Sergey Rostov
2fac72cd99 Move resources: remove build code that not required anymore 2018-11-30 15:01:02 +03:00
Sergey Rostov
df2e4524d7 Move resources from /src to separate /resources directory.
Previously this files was stored in /src directory and was included in
resources mainly by SourceSet.projectDefault from sourceSets.kt:

val processResources = tasks.getByName(processResourcesTaskName) as ProcessResources
processResources.from("resources") { include("**") }
processResources.from("src") { include("META-INF/**", "**/*.properties") }

Also there are some custom rules like this:

resources.srcDir("../idea-analysis/src").apply { include("**/*.properties") }
resources.srcDirs("idea-repl/src").apply { include("META-INF/**") }

All this rules are synthesized in script
https://github.com/snrostov/kotlin-migrate-resources/blob/master/src/main/kotlin/main.kt

This commit created using that script. See README.md for more details on
 script.
2018-11-30 15:01:01 +03:00
Yan Zhulanow
c5e241d5c6 Remove deprecated usages of CliOption in official compiler plugins 2018-11-27 22:21:22 +09:00
Ilya Chernikov
ae0b2405bc Add ide script settings for sources and accepted location 2018-10-25 13:09:34 +02:00
Nikolay Krasko
17421ed14d 191: asm-all has 7.0-beta version in Intellij 191
Pass project to fetch extra parameters for asm-all work
2018-10-19 19:16:21 +03:00
Mikhail Zarechenskiy
0da1b9b80f Revert "Migration change: temporarily specify type explicitly"
This reverts commit bc6e091004.

 This commit was needed to avoid bootstraping, now we can revert it
2018-09-26 11:51:57 +03:00
Mikhail Zarechenskiy
bc6e091004 Migration change: temporarily specify type explicitly
Because of introduction of `BuilderInference` annotation.
 Change it back after bootstrap
2018-09-18 18:55:26 +03:00
Ilya Chernikov
a03bfb3561 Implement support for non-kts scripts in gradle
#KT-26784 fixed
2018-09-13 20:47:21 +02:00
Ilya Chernikov
a02d5b4b21 Rename script annotation params according to configuration keys...
rename evaluation params consistently too
2018-09-11 14:56:51 +02:00
Ilya Chernikov
3f2552af60 Export filename extension from KotlinScriptDefinition, register...
extensions after loading definitions
2018-09-10 11:21:26 +02:00
Ilya Chernikov
836ea28fe7 Renaming remaining former "environment"-related identifiers 2018-09-06 19:17:44 +02:00
Ilya Chernikov
6716c512d3 [minor] Rename too long named functions 2018-09-06 19:17:43 +02:00
Ilya Chernikov
01eca8bac8 Clean up properties collection 2018-08-23 09:51:53 +03:00
Ilya Chernikov
c2e6c0ed49 Rename ScriptingEnvironment to ScriptingHostConfiguration 2018-08-23 09:51:53 +03:00
Ilya Chernikov
bd8f2a81e9 Rename ScriptDefinition to ScriptCompileConfiguration 2018-08-23 09:51:53 +03:00
Ilya Chernikov
da2b60ffa6 Fix discovery tests after refactoring 2018-08-23 09:51:53 +03:00
Ilya Chernikov
acb0f6c6a9 Remove ScriptCompileConfiguration as separate entity, refactor pieces accordingly 2018-08-23 09:51:53 +03:00
Ilya Chernikov
bda8089004 Fix asm annotations loading after annotations refactoring 2018-08-23 09:51:53 +03:00
Ilya Chernikov
ab63d59a56 Refactor definition keys 2018-08-23 09:51:53 +03:00
Ilya Chernikov
04ffe7754e Refactoring properties collection after review 2018-08-23 09:51:53 +03:00
Ilya Chernikov
74f8a541c0 Grand refactoring of the scripting DSL + many minor usability refactorings around it 2018-08-23 09:51:53 +03:00
Ilya Chernikov
70ec004aaa Sorting default jvm props and basic implementations 2018-08-23 09:51:53 +03:00
Ilya Chernikov
1de37ca765 Make KotlinScript annotation accepting all params needed to define a script 2018-08-23 09:51:53 +03:00
Ilya Chernikov
cf2162c445 Refactor properties 2018-08-23 09:51:53 +03:00
Ilya Chernikov
904917c194 Make script definition a property bag directly 2018-08-23 09:51:53 +03:00
Ilya Chernikov
8953bba47c Pass scripting (host) environment independently from properties/configuration 2018-08-23 09:51:53 +03:00
Ilya Chernikov
91e6c0b77c Remove evaluator from script definition, simplify interface 2018-08-23 09:51:53 +03:00
Ilya Chernikov
e61ba1fd70 Replace dedicated configurator with definition properties + refine fun 2018-08-23 09:51:53 +03:00
Ilya Chernikov
a54675abe7 Clean and fix new scripting API 2018-08-23 09:51:53 +03: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
Natalia Selezneva
41dc059da9 Register custom file extension for scripts loaded from script template 2018-08-03 15:25:35 +03:00
Ilya Chernikov
9549736d35 Fixes after review 2018-07-10 08:43:52 +02:00
Ilya Chernikov
0f46f62232 Add script class annotations generation from the base class 2018-07-10 08:43:51 +02:00
Ilya Chernikov
edf13c022e Refactor script definitions loading and discovery:
Improve logic, code reuse and readability
Add support for more corner cases
Improve reporting
Add definitions loading test
2018-07-10 08:43:51 +02:00
Ilya Chernikov
fbbfe600ec Fix list of script definitions recognized by the asm-based loading:
fix of the previous fix to #KT-24926
2018-07-10 08:43:50 +02:00
Ilya Chernikov
4812fcf1ad Fix script definition discovery logic:
for cases when directory-based dependencies are passed and directories
with resources are different from directories with classes
Significant refactoring to make code prettier
2018-07-10 08:43:50 +02:00
Ilya Chernikov
29adf09b7e Add test with other annotation, tests fix of #KT-2496 2018-06-15 12:01:49 +02:00
Rodrigo B. de Oliveira
e24a9d08f2 Only collect annotations with a name starting with KotlinScript 2018-06-15 11:53:49 +02:00
Ilya Chernikov
6fdb8746de Fixes after review 2018-05-28 22:10:56 +02:00
Ilya Chernikov
a46dd5b30e Avoid using reflected types in the scripting API
since it causes numerous classloading issues. Using the wrapping types
and reload them in the proper context when needed.
Note: this version supports only classes, but the wrapping type could
be extended to support other types in the future.
+ numerous fixes related to proper loading and handling of the templates.
2018-05-28 22:10:56 +02:00
Ilya Chernikov
92d848b6e6 Fix scripting plugin commandline processing 2018-05-25 09:51:04 +02:00
Ilya Chernikov
705faa4792 Add lazy discovery test 2018-05-25 09:51:04 +02:00
Ilya Chernikov
b3219cb762 Implement lazy script definition and light discovery in cli plugin, ...
update appropriate parts of the scripting infrastructure
2018-05-14 11:13:44 +02:00
Ilya Chernikov
516924cda1 Add support for script environment variables to the frontend 2018-05-03 22:15:09 +02:00
Ilya Chernikov
15f9ad9531 Implement quick non-script detection and lazy script discovery..
so ".kt" and ".java" files are not considered as scripts and quickly
filtered out, and for the other files the the checks are implemented
using sequences, mechanisms provided to supply script definitions
lazily, and script discovery is implemented using this mechanisms.
2018-05-03 22:15:09 +02:00
Ilya Chernikov
a29411a211 Process script templates everywhere properly:
- add options to disable scripting plugin and standard script definition
- move standard definition adding logic into appropriate place
- fix logic of scripting plugin loading
- add standard script definition on the environment creation to
  ensure compatibility with all usages
- fix testdata
- some minor fixes
2018-05-03 22:15:09 +02:00
Yan Zhulanow
715421566b Pill: Add new script modules 2018-04-09 19:45:49 +03:00
Ilya Chernikov
5bf8460032 Do not throw if the script definition name is not defined 2018-04-04 16:23:59 +02:00
Ilya Chernikov
191b1cfefa Refactor configurations handling:
- rearrange compile call parameters for clarity, more defaults
- remove baseConfiguration method - it is now covered by defaultConfiguration
for static part, and refineConfiguration call if a config parameter is
specified
- implement proper configurations chaining, documented in comment to compile function
- minor renamings and refactorings
2018-04-04 16:23:58 +02:00