Navigation Menu

Skip to content
This repository has been archived by the owner on Aug 19, 2020. It is now read-only.

Add ability to apply plugins in the included scripts #1359

Closed
imanushin opened this issue Mar 11, 2019 · 1 comment
Closed

Add ability to apply plugins in the included scripts #1359

imanushin opened this issue Mar 11, 2019 · 1 comment

Comments

@imanushin
Copy link

Currently I'm unable to install plugin from the external Kotlin Script.

Expected Behavior

As project developer I can:

  • Extract all common project parts to the separate scripts. For example it is better to extract plugin applying (e.g. java + kotlin) and plugin configuring (e.g. byte code version) to the separate script.
  • Then include this script by line apply(file="common-java.gradle.kts")
  • As a result: target project is able to use plugin, which was applied in the included file. For example: you can add line compile(group="org.jetbrains.kotlinx", name="kotlinx-coroutines-core", version="1.1.1").

Current Behavior

As project developer I can:

  • Extract all common project parts to the separate scripts. For example it is better to extract plugin applying (e.g. java + kotlin) and plugin configuring (e.g. byte code version) to the separate script.
  • Then include this script by line apply(file="common-java.gradle.kts")

However I could not use plugin (which is mentioned in the included file only), because the following construction is not correct (e.g. method was not found): compile(group="org.jetbrains.kotlinx", name="kotlinx-coroutines-core", version="1.1.1").

Context

I'd like to achieve:

  • Extract project configuration to the include file (or to the analogue)
  • Then in the target project I can include only part of files. For example:
    ** Add something like apply(file="common-java.gradle.kts") just to have project with Java support, however without artifact publication abilities.
    ** Add something like apply(file="common-server-java.gradle.kts") to have project with Java support, however this project will be published to somewhere.
    ** Include nothing: for totaly custom projects. As an example: it can be JS project (e.g. just kotlin wrappers upper to node plugin).

Steps to Reproduce (for bugs)

n/a (feature request)

Your Environment

n/a

@eskatos
Copy link
Member

eskatos commented Apr 24, 2019

Thank you for the report @imanushin, closing as a duplicate of #1287, see in particular #1287 (comment).

@eskatos eskatos closed this as completed Apr 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants