IDEA project configuration: JSch converted to repository library

This commit is contained in:
nik
2017-12-18 15:00:56 +03:00
parent 9a828df4a3
commit adc9ccdd5a
5 changed files with 12 additions and 7 deletions
+4 -3
View File
@@ -1,11 +1,12 @@
<component name="libraryTable">
<library name="JSch">
<library name="JSch" type="repository">
<properties maven-id="com.jcraft:jsch:0.1.54" />
<CLASSES>
<root url="jar://$PROJECT_DIR$/lib/jsch-0.1.54.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/com/jcraft/jsch/0.1.54/jsch-0.1.54.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/lib/src/jsch-0.1.54.zip!/jsch-0.1.54/src/main/java" />
<root url="jar://$MAVEN_REPOSITORY$/com/jcraft/jsch/0.1.54/jsch-0.1.54-sources.jar!/" />
</SOURCES>
</library>
</component>
Binary file not shown.
Binary file not shown.
@@ -120,13 +120,17 @@ class BuildUtils {
* Defines sshexec task using libraries from IntelliJ IDEA project sources.
*/
@CompileDynamic
static void defineSshTask(AntBuilder ant, String communityLib) {
static void defineSshTask(BuildContext context) {
List<File> jschJars = context.project.libraryCollection.findLibrary("JSch").getFiles(JpsOrderRootType.COMPILED) +
[new File(context.paths.communityHome, "lib/ant/lib/ant-jsch.jar")]
def ant = context.ant
def sshTaskLoaderRef = "SSH_TASK_CLASS_LOADER"
if (ant.project.hasReference(sshTaskLoaderRef)) return
Path pathSsh = new Path(ant.project)
pathSsh.createPathElement().setLocation(new File("$communityLib/jsch-0.1.54.jar"))
pathSsh.createPathElement().setLocation(new File("$communityLib/ant/lib/ant-jsch.jar"))
jschJars.each {
pathSsh.createPathElement().setLocation(it)
}
ant.project.addReference(sshTaskLoaderRef, new SplitClassLoader(ant.project.getClass().getClassLoader(), pathSsh, ant.project,
["SSHExec", "SSHBase", "LogListener", "SSHUserInfo"] as String[]))
ant.taskdef(name: "sshexec", classname: "org.apache.tools.ant.taskdefs.optional.ssh.SSHExec", loaderRef: sshTaskLoaderRef)
@@ -62,7 +62,7 @@ class MacDmgBuilder {
private static MacDmgBuilder createInstance(BuildContext buildContext, MacDistributionCustomizer customizer, MacHostProperties macHostProperties) {
BuildUtils.defineFtpTask(buildContext)
BuildUtils.defineSshTask(buildContext.ant, "${buildContext.paths.communityHome}/lib")
BuildUtils.defineSshTask(buildContext)
String currentDateTimeString = LocalDateTime.now().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME).replace(':', '-')
int randomSeed = new Random().nextInt(Integer.MAX_VALUE)