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

Gradle instrument plugin does not support other jvm languages #731

Closed
IzzelAliz opened this issue Jun 3, 2018 · 8 comments
Closed

Gradle instrument plugin does not support other jvm languages #731

IzzelAliz opened this issue Jun 3, 2018 · 8 comments
Assignees

Comments

@IzzelAliz
Copy link

The plugin will use java's output dir as default dir, and the compiled scala classes cannot be instrumented.

> Task :compileScala 
Pruning sources from previous analysis, due to incompatible CompileSetup.

> Task :instrumentModels 
**************************** START INSTRUMENTATION ****************************
Directory: F:\workspace\Proj\build\classes\java\main
**************************** END INSTRUMENTATION ****************************
@ipolevoy
Copy link
Member

ipolevoy commented Jul 6, 2018

@IzzelAliz feel free to send in a PR to close this

@cschabl
Copy link
Contributor

cschabl commented Jul 31, 2018

@IzzelAliz is there more than making the classes dir of the plugin configurable?

@cschabl
Copy link
Contributor

cschabl commented Aug 7, 2018

@ipolevoy, I would offer a PR. I.e. making the classes dir configurable. Or is @yanchevsky going to fix this?

@ipolevoy
Copy link
Member

ipolevoy commented Aug 7, 2018

@cschabl go ahead, I think @yanchevsky is buried in work now .

@cschabl
Copy link
Contributor

cschabl commented Aug 9, 2018

@ipolevoy, @IzzelAliz, there is nothing to change in the gradle plugin. With some Gradle scripting you can tell the ActiveJDBC gradle plugin to instrument your Scala classes:

buildscript {
    repositories {
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath group: 'org.javalite', name: 'activejdbc-gradle-plugin', version: '2.0'
        classpath 'org.scala-lang:scala-library:2.12.6'
    }
}

plugins {
    id 'scala'
}

apply plugin: 'org.javalite.activejdbc'

instrumentModels {
    // assuming Gradle 4.0 or higher
    classesDir = project.sourceSets.main.scala.outputDir.getPath()
    outputDir = classesDir
}
...

The ActiveJDBC plugin doesn't support both Java and Scala model classes, because it supports a single classes directory.

@ipolevoy
Copy link
Member

@cschabl the Gradle plugin migrated to https://github.com/cschabl/activejdbc-gradle-plugin, does it make sense to migrate this issue as well?

@cschabl
Copy link
Contributor

cschabl commented Jul 24, 2019

@ipolevoy , as for support of Scala you can close this issue with "won't fix" and link to the migrated Gradle plugin, because it supports Scala. But it doesn't support Kotlin like the Maven plugin, so far.

@ipolevoy
Copy link
Member

@cschabl makes sense, closing. For those interested in Scala support, use https://github.com/cschabl/activejdbc-gradle-plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants