about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/editors/jetbrains/patches/no-download.patch
blob: f82d8c04016c19d0f03543124b6669b1eca61e09 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
--- a/build/deps/src/org/jetbrains/intellij/build/impl/BundledMavenDownloader.kt
+++ b/build/deps/src/org/jetbrains/intellij/build/impl/BundledMavenDownloader.kt
@@ -87,13 +87,13 @@
           }
           val targetFile = root.resolve("${split[1]}-${split[2]}.jar")
           val uri = BuildDependenciesDownloader.getUriForMavenArtifact(
-            mavenRepository = BuildDependenciesConstants.MAVEN_CENTRAL_URL,
+            mavenRepository = "MAVEN_REPO_HERE",
             groupId = split[0],
             artifactId = split[1],
             version = split[2],
             packaging = "jar"
           )
-          targetFile to downloadFileToCacheLocation(uri.toString(), communityRoot)
+          targetFile to Path.of(uri.toString())
         }
       }
     }.asSequence().map { it.getCompleted() }.toMap()
@@ -133,21 +133,6 @@
   }
 
   suspend fun downloadMavenDistribution(communityRoot: BuildDependenciesCommunityRoot): Path {
-    val extractDir = communityRoot.communityRoot.resolve("plugins/maven/maven36-server-impl/lib/maven3")
-    val properties = BuildDependenciesDownloader.getDependenciesProperties(communityRoot)
-    val bundledMavenVersion = properties.property("bundledMavenVersion")
-    mutex.withLock {
-      val uri = BuildDependenciesDownloader.getUriForMavenArtifact(
-        mavenRepository = BuildDependenciesConstants.MAVEN_CENTRAL_URL,
-        groupId = "org.apache.maven",
-        artifactId = "apache-maven",
-        version = bundledMavenVersion,
-        classifier = "bin",
-        packaging = "zip"
-      )
-      val zipPath = downloadFileToCacheLocation(uri.toString(), communityRoot)
-      BuildDependenciesDownloader.extractFile(zipPath, extractDir, communityRoot, BuildDependenciesExtractOptions.STRIP_ROOT)
-    }
-    return extractDir
+    return Path.of("MAVEN_PATH_HERE")
   }
 }
--- a/platform/build-scripts/downloader/src/org/jetbrains/intellij/build/dependencies/BuildDependenciesDownloader.kt
+++ b/platform/build-scripts/downloader/src/org/jetbrains/intellij/build/dependencies/BuildDependenciesDownloader.kt
@@ -70,7 +70,7 @@
                              version: String,
                              classifier: String?,
                              packaging: String): URI {
-    val base = mavenRepository.trim('/')
+    val base = mavenRepository.trimEnd('/')
     val groupStr = groupId.replace('.', '/')
     val classifierStr = if (classifier != null) "-${classifier}" else ""
     return URI.create("${base}/${groupStr}/${artifactId}/${version}/${artifactId}-${version}${classifierStr}.${packaging}")
--- a/platform/build-scripts/downloader/src/org/jetbrains/intellij/build/dependencies/JdkDownloader.kt
+++ b/platform/build-scripts/downloader/src/org/jetbrains/intellij/build/dependencies/JdkDownloader.kt
@@ -25,11 +25,7 @@
   }
 
   fun getJdkHome(communityRoot: BuildDependenciesCommunityRoot, os: OS, arch: Arch, infoLog: (String) -> Unit): Path {
-    val jdkUrl = getUrl(communityRoot, os, arch)
-    val jdkArchive = BuildDependenciesDownloader.downloadFileToCacheLocation(communityRoot, jdkUrl)
-    val jdkExtracted = BuildDependenciesDownloader.extractFileToCacheLocation(
-      communityRoot, jdkArchive, BuildDependenciesExtractOptions.STRIP_ROOT)
-    infoLog("jps-bootstrap JDK is at $jdkExtracted")
+    val jdkExtracted = Path.of("JDK_PATH_HERE")
 
     val jdkHome: Path = if (os == OS.MACOSX) {
       jdkExtracted.resolve("Contents").resolve("Home")
--- a/platform/build-scripts/src/org/jetbrains/intellij/build/LinuxDistributionCustomizer.kt
+++ b/platform/build-scripts/src/org/jetbrains/intellij/build/LinuxDistributionCustomizer.kt
@@ -46,7 +46,7 @@
   /**
    * If `true`, a separate *[org.jetbrains.intellij.build.impl.LinuxDistributionBuilder.NO_RUNTIME_SUFFIX].tar.gz artifact without a runtime will be produced.
    */
-  var buildArtifactWithoutRuntime = false
+  var buildArtifactWithoutRuntime = true
 
   /**
    * Set both properties if a .snap package should be produced.
--- a/platform/build-scripts/src/org/jetbrains/intellij/build/impl/LinuxDistributionBuilder.kt
+++ b/platform/build-scripts/src/org/jetbrains/intellij/build/impl/LinuxDistributionBuilder.kt
@@ -45,7 +45,7 @@
       withContext(Dispatchers.IO) {
         val distBinDir = targetPath.resolve("bin")
         val sourceBinDir = context.paths.communityHomeDir.resolve("bin/linux")
-        copyFileToDir(NativeBinaryDownloader.downloadRestarter(context = context, os = OsFamily.LINUX, arch = arch), distBinDir)
+        copyFileToDir(sourceBinDir.resolve("${arch.dirName}/restarter"), distBinDir)
         copyFileToDir(sourceBinDir.resolve("${arch.dirName}/fsnotifier"), distBinDir)
         copyFileToDir(sourceBinDir.resolve("${arch.dirName}/libdbm.so"), distBinDir)
         generateBuildTxt(context, targetPath)
@@ -85,6 +85,8 @@
         }
       }
 
+      return@executeStep
+
       val runtimeDir = context.bundledRuntime.extract(os = OsFamily.LINUX, arch = arch)
       updateExecutablePermissions(runtimeDir, executableFileMatchers)
       val tarGzPath = buildTarGz(arch = arch, runtimeDir = runtimeDir, unixDistPath = osAndArchSpecificDistPath, suffix = suffix(arch))
--- a/platform/build-scripts/src/org/jetbrains/intellij/build/impl/brokenPlugins.kt
+++ b/platform/build-scripts/src/org/jetbrains/intellij/build/impl/brokenPlugins.kt
@@ -11,6 +11,7 @@
 import java.nio.file.Files
 import java.nio.file.Path
 import java.util.*
+import kotlin.io.path.readText
 
 private const val MARKETPLACE_BROKEN_PLUGINS_URL = "https://plugins.jetbrains.com/files/brokenPlugins.json"
 
@@ -22,7 +23,7 @@
 
   val allBrokenPlugins = try {
     val jsonFormat = Json { ignoreUnknownKeys = true }
-    val content = downloadAsText(MARKETPLACE_BROKEN_PLUGINS_URL)
+    val content = Path.of("BROKEN_PLUGINS_HERE").readText()
     jsonFormat.decodeFromString(ListSerializer(MarketplaceBrokenPlugin.serializer()), content)
   }
   catch (e: Exception) {
--- a/platform/build-scripts/src/org/jetbrains/intellij/build/kotlin/KotlinCompilerDependencyDownloader.kt
+++ b/platform/build-scripts/src/org/jetbrains/intellij/build/kotlin/KotlinCompilerDependencyDownloader.kt
@@ -23,31 +23,11 @@
 
 object KotlinCompilerDependencyDownloader {
   fun downloadAndExtractKotlinCompiler(communityRoot: BuildDependenciesCommunityRoot): Path {
-    val kotlinJpsPluginVersion = getKotlinJpsPluginVersion(communityRoot)
-    val kotlinDistUrl = getUriForMavenArtifact(MAVEN_REPOSITORY_URL, ARTIFACT_GROUP_ID, "kotlin-dist-for-ide", kotlinJpsPluginVersion, "jar")
-    val kotlinDistJar = downloadFileToCacheLocation(communityRoot, kotlinDistUrl)
-    return extractFileToCacheLocation(communityRoot, kotlinDistJar)
+    return Path.of("KOTLIN_PATH_HERE")
   }
 
   suspend fun downloadKotlinJpsPlugin(communityRoot: BuildDependenciesCommunityRoot): Path = withContext(Dispatchers.IO) {
-    val kotlinJpsPluginVersion = getKotlinJpsPluginVersion(communityRoot)
-    val kotlinJpsPluginUrl = getUriForMavenArtifact(MAVEN_REPOSITORY_URL, ARTIFACT_GROUP_ID, "kotlin-jps-plugin-classpath", kotlinJpsPluginVersion, "jar")
-
-    val cacheLocation = getTargetFile(communityRoot, kotlinJpsPluginUrl.toString())
-    if (cacheLocation.exists()) {
-      return@withContext cacheLocation
-    }
-
-    // Download file by hand since calling entire ktor/cio/coroutines stuff *before* loading JPS plugin into classpath
-    // leads to funny kotlin-reflect failures later in Kotlin JPS plugin
-    // Ideal solution would be to move compilation to other process altogether and do not modify current process classpath
-    println(" * Downloading $kotlinJpsPluginUrl")
-    val tmpLocation = Files.createTempFile(cacheLocation.parent, cacheLocation.name, ".tmp")
-    suspendingRetryWithExponentialBackOff {
-      FileUtils.copyURLToFile(kotlinJpsPluginUrl.toURL(), tmpLocation.toFile())
-    }
-    Files.move(tmpLocation, cacheLocation, StandardCopyOption.ATOMIC_MOVE)
-    return@withContext cacheLocation
+    return@withContext Path.of("JPS_PLUGIN_CLASSPATH_HERE")
   }
 
   fun getKotlinJpsPluginVersion(communityRoot: BuildDependenciesCommunityRoot): String {