How to manually download ideaIC sdk in gradle build task?

Answered

Unfortunately, since I have a very slow network, when I build an intellij-plugin for the first time, it takes me hours to download the ideaIC sdk (e.g. in following picture, the ideaIC-212.3116-EAP-CANDIDATE-SNAPSHOT.zip), and the download fails easily T_T.   But using chrome, I can download it a lot easier (In fact I've already downloaded it this way) ,  so is there any way to help me:

during "./gradlew build", do not download that zip, but use my local downloaded one.

Do I need to modify my build.gradle script? I've tried somehow, but not worked.

1
2 comments

Xiarui Xr, it is possible to use the manually downloaded archive – you'll need to put it into the proper location:

  1. Let's assume we'll work with ideaIC-212.3116-EAP-CANDIDATE-SNAPSHOT.zip
  2. Create base directory for your dependency: ~/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/212.3116-EAP-CANDIDATE-SNAPSHOT/
  3. Calculate the SHA hash, i.e. with shasum ideaIC-212.3116-EAP-CANDIDATE-SNAPSHOT.zip – it will give: f86e416ceecaf64be9309591fffe0ad60c43d486
  4. Create a subdirectory called f86e416ceecaf64be9309591fffe0ad60c43d486, so it'd be: 
  5. ~/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/212.3116-EAP-CANDIDATE-SNAPSHOT/f86e416ceecaf64be9309591fffe0ad60c43d486/
  6. Put ZIP file in there and extract, so it's content would be located in: ~/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/212.3116-EAP-CANDIDATE-SNAPSHOT/f86e416ceecaf64be9309591fffe0ad60c43d486/ideaIC-212.3116-EAP-CANDIDATE-SNAPSHOT/...
  7. Create a POM file called: ideaIC-212.3116-EAP-CANDIDATE-SNAPSHOT.pom with the following content:
    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.jetbrains.intellij.idea</groupId>
    <artifactId>ideaIC</artifactId>
    <version>212.3116-EAP-CANDIDATE-SNAPSHOT</version>
    <packaging>zip</packaging>
    </project>
  8. Calculate SHA hash of that file -> 1010e4a4190631bec8fbabd5c07a93cf358c210
  9. Create a subdirectory and put POM in there: ....../1010e4a4190631bec8fbabd5c07a93cf358c210/ideaIC-212.3116-EAP-CANDIDATE-SNAPSHOT.pom

That should do the job.

2

Thank you so much for your intimate reply, I've tried it and it works properly! That saves me so much time!

0

Please sign in to leave a comment.