ebean-orm-tools / ebean-gradle-plugin

Plugin that performs Enhancement (entity, transactional, query bean) and can generate query beans from entity beans written in Kotlin via kapt
Apache License 2.0
10 stars 12 forks source link

Cannot enhance entity class with kotlin v.1.7.0 #33

Closed kklongming closed 2 years ago

kklongming commented 2 years ago

KotlinCompile is no longer a subclass of AbstractCompile since kotlin v.1.7.0

plugin ver: 13.6.4

io/ebean/gradle/EnhancePlugin.groovy:112

rbygrave commented 2 years ago

So we need to determine how to detect KotlinCompile in a new way.

Note that we have https://github.com/ebean-orm/examples/tree/master/basic-gradle-kotlin ... as our basic gradle + kotlin project so this is the example we want to keep up to date and can submit PR's for this when things no longer work etc.

rbygrave commented 2 years ago

Notes on using a locally installed version of the plugin from localMaven:

In settings.gradle add:

pluginManagement {
  repositories {
    mavenLocal()
    gradlePluginPortal()
  }
}

In the build.gradle add:

buildscript{
  repositories {
    mavenLocal()
    dependencies{
      classpath 'io.ebean:ebean-gradle-plugin:13.6.4.1'
    }
  }
}

and in plugins remove the use of id(io.ebean) ... there and add:

plugins {
  id('idea')
//  id('ebean') version '13.6.4.1'
  id('org.jetbrains.kotlin.jvm') version '1.7.0'
  id('org.jetbrains.kotlin.kapt') version '1.7.0'
}

apply plugin: 'io.ebean'
rbygrave commented 2 years ago

Fixed in version 13.6.4.1 which has been released to gradle plugin repository:

plugins {
  id('idea')
  id('io.ebean') version '13.6.4.1'
  id('org.jetbrains.kotlin.jvm') version '1.7.0'
  id('org.jetbrains.kotlin.kapt') version '1.7.0'
}