Questions tagged [kotlin-allopen]
7 questions
13
votes
1 answer
What is an open property? Why I can't make its setter to private?
What is the difference between a Property and Open Property in Kotlin? The code below complains on me declaring the setter private and Intellij says private setters are not allowed for open properties. What is an open property?
@RestController
open…

greyfox
- 6,426
- 23
- 68
- 114
7
votes
1 answer
Kotlin-allopen plugin + @JvmField on a val not final enough
I am testing a new kotlin-allopen and kotlin-spring plugins under Kotlin 1.0.6.
In one of my @Transactional-annotated classes I have a field:
@JvmField val foo = null
When I try to build the project, I get:
Error:(45, 5) Kotlin: JvmField can only…

Grzegorz Piwowarek
- 13,172
- 8
- 62
- 93
6
votes
0 answers
Gradle apply kotlin-allopen plugin only for tests
I have a android module that uses Kotlin and by using kotlin-all open class I am making sure that I still can mock my Kotlin classes with Mockito. The problem is with this approach it makes my Kotlin classes open outside testing as well and now…

Alireza Ahmadi
- 5,122
- 7
- 40
- 67
6
votes
2 answers
Kotlin-allopen for android
Is it possible to use kotlin-allopen gradle plugin for android testing with mockito?
I've tried to add kotlin-allopen plugin to my build.gradle and define the annotation.
buildscript {
ext.kotlin_version = '1.0.6'
dependencies {
…

Aleksei Potapkin
- 1,021
- 12
- 23
5
votes
1 answer
How to enable AllOpen plugin for android
I am trying to add the allopen plugin for android.
I added this to my build.gradle(.)
ext.kotlin_version = '1.3.61'
classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlin_version"
I added this to my app/build.gradle
apply plugin:…

Lena Bru
- 13,521
- 11
- 61
- 126
0
votes
0 answers
allOpen for all kotlin class
I write kotlin DSL in separate repository. All class in this gradle project is class for my DSL. I want to be sure that all classes will be open. I now about allopen plugin, but it need annotation. I don't want to use an annotation, because I can…

Тим
- 53
- 4
0
votes
1 answer
How to make Kotlin AllOpen Plugin work with STS/Maven?
I configured everything to use JDK 1.8, but still my application fail to start.
Editor Error: Cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6. Please specify proper ‘-jvm-target’…

KaomiDev
- 61
- 6