KotlinScriptPlugin.kt

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Convert to multi-project build in preparation to adding new modules

See #304

  1. … 263 more files in changeset.
Polish

- Normalise placement of `private`, `protected`, `internal` and

`inline` modifiers

  1. … 42 more files in changeset.
Remove ProjectExtensionsTaskRegistrationAction, apply a plugin instead

That way, no need to check for .kts files presence.

Builds not using gsk won’t suffer the performance penalty anymore.

Builds using gsk will benefit a small performance gain.

See #320

  1. … 4 more files in changeset.
Improve logging behaviour

- Make compiler messages format closer to Kotlin's

- Format messages only if the will be logged

  1. … 6 more files in changeset.
Polish top-level definitions, parameter lists and exceptions

* Separate top-level definitions by two lines

* Segregate visibility modifier of top-level definition to

its own line

* Prefer starting long parameter lists at the next line (more

sustainable in face of method renames)

* Remove unnecessary `Exception` suffix from class names

* Remove unnecessary prefixes from field names

* Use better name for exception variables

  1. … 38 more files in changeset.
Change logging level from info to debug

To avoid cluttering the info level.

  1. … 1 more file in changeset.
Import java.lang exceptions for compatibility with Kotlin plugin

Version 1.1.0-dev-3687

  1. … 6 more files in changeset.
Serve script model even if no Kotlin script runs

Resolves #113

  1. … 7 more files in changeset.
Polish Kotlin sources

- Add Apache license header where missing

- Replace wildcard imports with individual imports

- Organize import statements

- Wrap code at 120 chars

- Wrap KDoc at 90 chars

- Eliminate newlines between KDoc tags

  1. … 20 more files in changeset.
Remove unused import

Remove generateKtsConfig and patchIdeaConfig tasks

These tasks are obsolete as of the resolution of #26 and #43.

Resolves #79

  1. … 3 more files in changeset.
Provide IDE classpath via custom TAPI model

  1. … 4 more files in changeset.
Support for `buildscript` section (wip)

  1. … 10 more files in changeset.
Extract builtin tasks to its own plugin

And rely on idempotent plugin application instead of explicitly checking

for duplicate tasks.

  1. … 3 more files in changeset.
Don't create duplicate tasks

Fixes #6

  1. … 1 more file in changeset.
Attempt to reproduce 'loader constraint violation'

This is a work in progress attempt at reproducing the 'loader constraint

violation' observed when defining the following task:

task<Zip>("repackageKotlinCompilerEmbeddable") {

baseName = "kotlin-compiler-embeddable"

version = "${kotlinVersion}a"

extension = "jar"

entryCompression = ZipEntryCompression.STORED

from(Callable {

val files = configurations.getByName("compile").files

zipTree(files.single { it.name.startsWith(baseName) })

})

exclude("META-INF/services/java.nio.charset.spi.CharsetProvider")

destinationDir = buildDir

description = "Repackages '$baseName:$version' to remove broken META-INF/services files"

}

Which caused the following error:

loader constraint violation: when resolving method

"org.gradle.script.lang.kotlin.ProjectExtensionsKt.task(

Lorg/gradle/api/Project;Ljava/lang/String;Lkotlin/reflect/KClass;

Lkotlin/jvm/functions/Function1;)Lorg/gradle/api/Task;"

the class loader (instance of

org/jetbrains/kotlin/codegen/GeneratedClassLoader) of the current

class, Build_gradle, and the class loader (instance of

org/gradle/internal/classloader/MutableURLClassLoader) for the method's

defining class, org/gradle/script/lang/kotlin/ProjectExtensionsKt, have

different Class objects for the type kotlin/reflect/KClass used in the

signature

See #25

  1. … 3 more files in changeset.
Unwrap `InvocationTargetException`

So as to provide quicker failure feedback without the need for `--info`

or `--stacktrace`.

Improve package cohesion

This package reorganisation intends to reduce the API surface of

`org.gradle.script.lang.kotlin.*` which is imported on all build scripts

and improve cohesion by:

- Moving SPI implementation related types to a `provider` subpackage

- Moving task implementations to a `tasks` subpackage

- Moving supporting types and functions to a `support` subpackage

    • -0
    • +52
    ./KotlinScriptPlugin.kt
  1. … 14 more files in changeset.