Use javaClass instead of getClass()
This commit is contained in:
+3
-3
@@ -15,7 +15,7 @@ import org.gradle.api.initialization.dsl.ScriptHandler
|
||||
|
||||
abstract class KotlinBasePluginWrapper: Plugin<Project> {
|
||||
|
||||
val log = Logging.getLogger(getClass())
|
||||
val log = Logging.getLogger(this.javaClass)
|
||||
|
||||
public override fun apply(project: Project) {
|
||||
val sourceBuildScript = findSourceBuildScript(project);
|
||||
@@ -30,7 +30,7 @@ abstract class KotlinBasePluginWrapper: Plugin<Project> {
|
||||
log.debug("Loading version information")
|
||||
val props = Properties()
|
||||
val propFileName = "project.properties"
|
||||
val inputStream = getClass().getClassLoader()!!.getResourceAsStream(propFileName)
|
||||
val inputStream = this.javaClass.getClassLoader()!!.getResourceAsStream(propFileName)
|
||||
|
||||
if (inputStream == null) {
|
||||
throw FileNotFoundException("property file '" + propFileName + "' not found in the classpath")
|
||||
@@ -51,7 +51,7 @@ abstract class KotlinBasePluginWrapper: Plugin<Project> {
|
||||
val kotlinPluginDependencies : List<URL> = configuration.getResolvedConfiguration().getFiles(KSpec({ dep -> true }))!!.map({(f: File):URL -> f.toURI().toURL() })
|
||||
log.debug("Resolved files: [" + kotlinPluginDependencies.toString() + "]")
|
||||
log.debug("Load plugin in parent-last URL classloader")
|
||||
val kotlinPluginClassloader = ParentLastURLClassLoader(kotlinPluginDependencies, getClass().getClassLoader())
|
||||
val kotlinPluginClassloader = ParentLastURLClassLoader(kotlinPluginDependencies, this.javaClass.getClassLoader())
|
||||
log.debug("Class loader created")
|
||||
val cls = Class.forName(getPluginClassName(), true, kotlinPluginClassloader)
|
||||
log.debug("Plugin class loaded")
|
||||
|
||||
Reference in New Issue
Block a user