Skip to content

Commit

Permalink
Isolate classpath for tooling.jar
Browse files Browse the repository at this point in the history
  • Loading branch information
raniejade committed Mar 11, 2017
1 parent e84520c commit 1945181
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 18 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ buildscript {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "gradle.plugin.com.zoltu.gradle.plugin:git-versioning:2.0.21"
classpath "gradle.plugin.org.jetbrains:gradle-intellij-plugin:0.1.10"
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.4'
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
package org.jetbrains.spek.idea

import com.fasterxml.jackson.annotation.JsonCreator
import com.fasterxml.jackson.core.JsonFactory
import com.fasterxml.jackson.databind.BeanProperty
import com.fasterxml.jackson.module.kotlin.KotlinModule
import com.intellij.diagnostic.logging.LogConfigurationPanel
import com.intellij.execution.CommonJavaRunConfigurationParameters
import com.intellij.execution.DefaultExecutionResult
Expand Down Expand Up @@ -32,7 +28,6 @@ import com.intellij.openapi.options.SettingsEditorGroup
import com.intellij.openapi.util.JDOMExternalizerUtil
import com.intellij.util.Base64
import com.intellij.util.PathUtil
import joptsimple.OptionParser
import org.jdom.Element
import org.jetbrains.spek.tooling.Path
import org.jetbrains.spek.tooling.PathType
Expand Down Expand Up @@ -141,16 +136,16 @@ class SpekRunConfiguration(javaRunConfigurationModule: JavaRunConfigurationModul

val jars = mutableListOf(
/* tooling jar*/
PathUtil.getJarPathForClass(Path::class.java),

/* jackson */
PathUtil.getJarPathForClass(JsonFactory::class.java),
PathUtil.getJarPathForClass(JsonCreator::class.java),
PathUtil.getJarPathForClass(BeanProperty::class.java),
PathUtil.getJarPathForClass(KotlinModule::class.java),

/* jopt */
PathUtil.getJarPathForClass(OptionParser::class.java)
PathUtil.getJarPathForClass(Path::class.java)

// /* jackson */
// PathUtil.getJarPathForClass(JsonFactory::class.java),
// PathUtil.getJarPathForClass(JsonCreator::class.java),
// PathUtil.getJarPathForClass(BeanProperty::class.java),
// PathUtil.getJarPathForClass(KotlinModule::class.java),
//
// /* jopt */
// PathUtil.getJarPathForClass(OptionParser::class.java)
)

if (module.findClass(Launcher::class.qualifiedName) == null) {
Expand Down
25 changes: 22 additions & 3 deletions tooling/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
apply plugin: "idea"
apply plugin: "kotlin"

apply plugin: 'com.github.johnrengelman.shadow'

configurations {
relocate

compileOnly {
extendsFrom relocate
}
}

shadowJar {
configurations = [project.configurations.relocate]
classifier = null

relocate 'joptsimple', 'shadow.joptsimple'
relocate 'com.fasterxml', 'shadow.com.fasterxml'
}

jar.finalizedBy shadowJar

dependencies {
compileOnly "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
compileOnly "org.jetbrains.kotlin:kotlin-runtime:$kotlinVersion"

compile 'org.junit.platform:junit-platform-launcher:1.0.0-M3'
compile 'net.sf.jopt-simple:jopt-simple:5.0.3'
relocate 'net.sf.jopt-simple:jopt-simple:5.0.3'

compile ('com.fasterxml.jackson.module:jackson-module-kotlin:2.8.4') {
relocate ('com.fasterxml.jackson.module:jackson-module-kotlin:2.8.4') {
exclude group: 'org.jetbrains.kotlin'
}
}

0 comments on commit 1945181

Please sign in to comment.