snowe
04/15/2019, 7:39 PMinternal
functions of open
classes in the same package in main correct?kevinmost
04/15/2019, 8:12 PMinternal
doesn't mean one package, it means one module. A test is a separate module from the production sources.snowe
04/15/2019, 8:56 PMsnowe
04/15/2019, 8:57 PMa Gradle source set (with the exception that the test source set can access the internal declarations of main);
snowe
04/15/2019, 8:57 PMsnowe
04/15/2019, 8:57 PMkevinmost
04/15/2019, 9:00 PMtest
in particular, not a different test source-set (androidTest
for example)?kevinmost
04/15/2019, 9:00 PMsnowe
04/15/2019, 9:00 PMsnowe
04/15/2019, 9:00 PMkevinmost
04/15/2019, 9:02 PMinternal
classes from main
in test
? It should work if your main sources are in src/main
and your tests are in src/test
in the same modulesnowe
04/15/2019, 9:02 PMsnowe
04/15/2019, 9:03 PMsnowe
04/15/2019, 9:03 PMsrc/main/kotlin
, src/test/kotlin
jlleitschuh
04/15/2019, 9:05 PMinternal
fields.snowe
04/15/2019, 9:05 PMsnowe
04/15/2019, 9:05 PMjlleitschuh
04/15/2019, 9:05 PMsnowe
04/15/2019, 9:05 PMsnowe
04/15/2019, 9:05 PMjlleitschuh
04/15/2019, 9:05 PMsnowe
04/15/2019, 9:05 PMjlleitschuh
04/15/2019, 9:06 PMsnowe
04/15/2019, 9:06 PMsnowe
04/15/2019, 9:06 PMjlleitschuh
04/15/2019, 9:06 PMsrc/main/kotlin/[package]....
and your tests are in
src/test/kotlin/[package]....
?snowe
04/15/2019, 9:07 PMjlleitschuh
04/15/2019, 9:08 PMjlleitschuh
04/15/2019, 9:08 PMsnowe
04/15/2019, 9:08 PMjlleitschuh
04/15/2019, 9:08 PMsnowe
04/15/2019, 9:08 PMjlleitschuh
04/15/2019, 9:08 PMsnowe
04/15/2019, 9:09 PMjlleitschuh
04/15/2019, 9:09 PMsnowe
04/15/2019, 9:09 PMjlleitschuh
04/15/2019, 9:10 PMsnowe
04/15/2019, 9:10 PMsnowe
04/15/2019, 9:10 PMjlleitschuh
04/15/2019, 9:11 PMsnowe
04/15/2019, 9:11 PMplugins {
id("java")
id("nebula.kotlin") version "1.3.21"
id("nebula.maven-publish") version "8.1.0"
id("pluggle.sonar") version "0.0.1"
id("pluggle.versioning") version "0.0.1"
id("pluggle.publishing") version "0.0.1"
kotlin("plugin.jpa") version "1.3.21"
kotlin("plugin.spring") version "1.3.21"
}
snowe
04/15/2019, 9:11 PMjlleitschuh
04/15/2019, 9:11 PMsnowe
04/15/2019, 9:12 PMjlleitschuh
04/15/2019, 9:12 PMinternal
thing fail only in IJ or does the compiler fail to find it as well (when run with Gradle)? Are you 100% certain you have whatever you want to access in your tests correctly imported?snowe
04/15/2019, 9:12 PMkevinmost
04/15/2019, 9:12 PMinternal class
in main
, and one method in test
that tries to access it?snowe
04/15/2019, 9:13 PMkevinmost
04/15/2019, 9:13 PMjlleitschuh
04/15/2019, 9:13 PMkevinmost
04/15/2019, 9:13 PMjlleitschuh
04/15/2019, 9:14 PMsnowe
04/15/2019, 9:14 PMsnowe
04/15/2019, 9:14 PMsnowe
04/15/2019, 9:14 PMsnowe
04/15/2019, 9:14 PMdistributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip
jlleitschuh
04/15/2019, 9:15 PMjlleitschuh
04/15/2019, 9:15 PMsnowe
04/15/2019, 9:15 PMsnowe
04/15/2019, 9:20 PMkevinmost
04/15/2019, 9:21 PMkevinmost
04/15/2019, 9:21 PMsnowe
04/15/2019, 9:26 PMsnowe
04/15/2019, 9:30 PMsnowe
04/15/2019, 9:30 PMMike
04/15/2019, 11:40 PMsnowe
04/16/2019, 5:08 PMsnowe
04/16/2019, 5:08 PMMike
04/16/2019, 5:29 PMinternal
, I find it’s fairly rare to use it. Unless you’re developing a library, that is.snowe
04/16/2019, 8:17 PMsnowe
04/16/2019, 8:18 PMprotected
, which of course doesn't do the same thing in kotlin, but internal should work just as fine in this case.snowe
04/16/2019, 8:18 PM