Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More user-friendly Gradle plugin #7

Closed
elizarov opened this issue Jul 18, 2018 · 2 comments
Closed

More user-friendly Gradle plugin #7

elizarov opened this issue Jul 18, 2018 · 2 comments
Assignees

Comments

@elizarov
Copy link
Contributor

Current usage of Gradle plugin is quite verbose. As explained in README it takes a lot of steps that you need to copy-paste into your gradle project file:

def CLASSES_POST_ATOMICFU = file("$buildDir/classes-post-atomicfu/main")

atomicFU {
    inputFiles = sourceSets.main.output.classesDirs
    outputDir = CLASSES_POST_ATOMICFU
    classPath = sourceSets.main.runtimeClasspath
    variant = "FU" // "VH" to use Java 9 VarHandle, "BOTH" to produce multi-version code
}

atomicFU.dependsOn compileKotlin
testClasses.dependsOn atomicFU
jar.dependsOn atomicFU

jar {
    mainSpec.sourcePaths.clear() // hack to clear existing paths
    from files(CLASSES_POST_ATOMICFU, sourceSets.main.output.resourcesDir)
}

While we'd like to continue supporting this syntax with explicit specification of inputFiles, outputDir and classPath for backwards compatibility, we'd like to be able to have a completely new default behavior, so that just doing apply plugin: 'kotlinx-atomicfu' does all the magic and configures automatic transformation for all source sets.

SokolovaMaria added a commit that referenced this issue Jul 31, 2018
elizarov pushed a commit that referenced this issue Aug 3, 2018
elizarov pushed a commit that referenced this issue Aug 3, 2018
elizarov pushed a commit that referenced this issue Aug 3, 2018
elizarov pushed a commit that referenced this issue Aug 3, 2018
SokolovaMaria added a commit that referenced this issue Aug 6, 2018
SokolovaMaria added a commit that referenced this issue Aug 6, 2018
@Prototik
Copy link

Prototik commented Aug 7, 2018

Isn't it better to implement it as compiler subplugin? (if it possible with current api of course)

@Prototik
Copy link

Prototik commented Aug 7, 2018

Just looked to compiler api: seems not possible to add transformation plugin. It supports only few specialized cases: like annotation processing, adding new classes, refining modifiers, but not direct transforming. Not sure though.

SokolovaMaria added a commit to SokolovaMaria/kotlinx.atomicfu that referenced this issue Aug 9, 2018
elizarov pushed a commit that referenced this issue Aug 9, 2018
elizarov pushed a commit that referenced this issue Aug 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants