-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[workspace model tests] AT-427 Downloading public installers even on …
…dev build server GitOrigin-RevId: 77a44356c4e42dbea24566c52729114408a85496
- Loading branch information
1 parent
3549f79
commit b3fe73f
Showing
19 changed files
with
90 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
intellij.tools.ide.starter/src/com/intellij/ide/starter/ide/IdeDistribution.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,19 @@ | ||
package com.intellij.ide.starter.ide | ||
|
||
import java.nio.file.Path | ||
import kotlin.io.path.isRegularFile | ||
import kotlin.io.path.readText | ||
|
||
abstract class IdeDistribution { | ||
abstract fun installIde(unpackDir: Path, executableFileName: String): InstalledIde | ||
|
||
companion object { | ||
/** @return Product code and build number */ | ||
fun readProductCodeAndBuildNumberFromBuildTxt(buildTxtPath: Path): Pair<String, String> { | ||
require(buildTxtPath.isRegularFile()) { "Cannot find build.txt file" } | ||
|
||
val (productCode, build) = buildTxtPath.readText().trim().split("-", limit = 2) | ||
return Pair(productCode, build) | ||
} | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
intellij.tools.ide.starter/src/com/intellij/ide/starter/ide/IdeDownloader.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
package com.intellij.ide.starter.ide | ||
|
||
import com.intellij.ide.starter.ide.installer.IdeInstaller | ||
import com.intellij.ide.starter.ide.installer.IdeInstallerFile | ||
import com.intellij.ide.starter.models.IdeInfo | ||
import java.nio.file.Path | ||
|
||
interface IdeDownloader { | ||
fun downloadIdeInstaller(ideInfo: IdeInfo, installerDirectory: Path): IdeInstaller | ||
fun downloadIdeInstaller(ideInfo: IdeInfo, installerDirectory: Path): IdeInstallerFile | ||
} |
10 changes: 0 additions & 10 deletions
10
intellij.tools.ide.starter/src/com/intellij/ide/starter/ide/IdeInstallator.kt
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
intellij.tools.ide.starter/src/com/intellij/ide/starter/ide/IdeInstaller.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.intellij.ide.starter.ide | ||
|
||
import com.intellij.ide.starter.di.di | ||
import com.intellij.ide.starter.models.IdeInfo | ||
import org.kodein.di.direct | ||
import org.kodein.di.instance | ||
|
||
interface IdeInstaller { | ||
val downloader: IdeDownloader | ||
get() = di.direct.instance<IdeDownloader>() | ||
|
||
/** | ||
* @return <Build Number, InstalledIde> | ||
*/ | ||
fun install(ideInfo: IdeInfo): Pair<String, InstalledIde> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 10 additions & 7 deletions
17
...r/ide/installer/ExistingIdeInstallator.kt → ...ter/ide/installer/ExistingIdeInstaller.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 7 additions & 3 deletions
10
intellij.tools.ide.starter/src/com/intellij/ide/starter/ide/installer/IdeInstallerFactory.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
package com.intellij.ide.starter.ide.installer | ||
|
||
import com.intellij.ide.starter.ide.IdeInstallator | ||
import com.intellij.ide.starter.di.di | ||
import com.intellij.ide.starter.ide.IdeDownloader | ||
import com.intellij.ide.starter.ide.IdeInstaller | ||
import com.intellij.ide.starter.ide.IdeProductProvider | ||
import com.intellij.ide.starter.models.IdeInfo | ||
import org.kodein.di.direct | ||
import org.kodein.di.instance | ||
|
||
open class IdeInstallerFactory { | ||
open fun createInstaller(ideInfo: IdeInfo): IdeInstallator { | ||
open fun createInstaller(ideInfo: IdeInfo, downloader: IdeDownloader = di.direct.instance<IdeDownloader>()): IdeInstaller { | ||
return if (ideInfo.productCode == IdeProductProvider.AI.productCode) | ||
AndroidInstaller() | ||
else | ||
SimpleInstaller() | ||
StandardInstaller(downloader) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 7 additions & 6 deletions
13
.../starter/ide/installer/SimpleInstaller.kt → ...tarter/ide/installer/StandardInstaller.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.