Skip to content

Commit 8fd522e

Browse files
rlimanodnyababrooksvvchikoti1998breedloj
committed
CodeCatalyst re:Invent 2022
Co-authored-by: Richard Li <[email protected]> Co-authored-by: Manodnya Bhoite <[email protected]> Co-authored-by: Austin Brooks <[email protected]> Co-authored-by: Vineeth Chikoti <[email protected]> Co-authored-by: Jonathan Breedlove <[email protected]> Co-authored-by: Kyle Thomson <[email protected]>
1 parent 2d17a98 commit 8fd522e

File tree

213 files changed

+12618
-414
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

213 files changed

+12618
-414
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "feature",
3+
"description" : "Amazon CodeCatalyst: Connect JetBrains to your remote Dev Environments."
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "feature",
3+
"description" : "Amazon CodeCatalyst: Clone your repositories to your local machine."
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "feature",
3+
"description" : "Amazon CodeCatalyst: Connect using your AWS Builder ID."
4+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="Run IDE - Gateway [2022.2]" type="GradleRunConfiguration" factoryName="Gradle" folderName="2022.2">
3+
<log_file alias="idea.log" path="$PROJECT_DIR$/jetbrains-gateway/build/idea-sandbox/system/log/idea.log" />
4+
<ExternalSystemSettings>
5+
<option name="executionName" />
6+
<option name="externalProjectPath" value="$PROJECT_DIR$/jetbrains-gateway" />
7+
<option name="externalSystemIdString" value="GRADLE" />
8+
<option name="scriptParameters" value="-PideProfileName=2022.2" />
9+
<option name="taskDescriptions">
10+
<list />
11+
</option>
12+
<option name="taskNames">
13+
<list>
14+
<option value="runIde" />
15+
</list>
16+
</option>
17+
<option name="vmOptions" />
18+
</ExternalSystemSettings>
19+
<ExternalSystemDebugServerProcess>false</ExternalSystemDebugServerProcess>
20+
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
21+
<DebugAllEnabled>false</DebugAllEnabled>
22+
<method v="2" />
23+
</configuration>
24+
</component>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="Run IDE - Gateway [2022.3]" type="GradleRunConfiguration" factoryName="Gradle" folderName="2022.3">
3+
<log_file alias="idea.log" path="$PROJECT_DIR$/jetbrains-gateway/build/idea-sandbox/system/log/idea.log" />
4+
<ExternalSystemSettings>
5+
<option name="executionName" />
6+
<option name="externalProjectPath" value="$PROJECT_DIR$/jetbrains-gateway" />
7+
<option name="externalSystemIdString" value="GRADLE" />
8+
<option name="scriptParameters" value="-PideProfileName=2022.3" />
9+
<option name="taskDescriptions">
10+
<list />
11+
</option>
12+
<option name="taskNames">
13+
<list>
14+
<option value="runIde" />
15+
</list>
16+
</option>
17+
<option name="vmOptions" />
18+
</ExternalSystemSettings>
19+
<ExternalSystemDebugServerProcess>false</ExternalSystemDebugServerProcess>
20+
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
21+
<DebugAllEnabled>false</DebugAllEnabled>
22+
<method v="2" />
23+
</configuration>
24+
</component>

buildSrc/src/main/kotlin/software/aws/toolkits/gradle/BuildScriptUtils.kt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33

44
package software.aws.toolkits.gradle
55

6+
import org.eclipse.jgit.api.Git
67
import org.gradle.api.JavaVersion
78
import org.gradle.api.Project
89
import org.gradle.api.provider.Provider
910
import software.aws.toolkits.gradle.intellij.IdeVersions
11+
import java.io.IOException
1012

1113
/**
1214
* Only run the given block if this build is running within a CI system (e.g. GitHub actions, CodeBuild etc)
@@ -30,3 +32,22 @@ fun Project.jvmTarget(): Provider<JavaVersion> {
3032
}
3133

3234
val kotlinTarget = "1.5"
35+
36+
fun Project.buildMetadata() =
37+
try {
38+
val git = Git.open(rootDir)
39+
val currentShortHash = git.repository.findRef("HEAD").objectId.abbreviate(7).name()
40+
val isDirty = git.status().call().hasUncommittedChanges()
41+
42+
buildString {
43+
append(currentShortHash)
44+
45+
if (isDirty) {
46+
append(".modified")
47+
}
48+
}
49+
} catch(e: IOException) {
50+
logger.warn("Could not determine current commit", e)
51+
52+
"unknownCommit"
53+
}

buildSrc/src/main/kotlin/software/aws/toolkits/gradle/intellij/IdeVersions.kt

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,23 @@ import org.gradle.api.Project
77
import org.gradle.api.provider.Provider
88
import org.gradle.api.provider.ProviderFactory
99

10-
enum class IdeFlavor { IC, IU, RD }
10+
enum class IdeFlavor { GW, IC, IU, RD }
1111

1212
object IdeVersions {
1313
private val commonPlugins = arrayOf(
14+
"git4idea",
1415
"org.jetbrains.plugins.terminal",
1516
"org.jetbrains.plugins.yaml"
1617
)
1718

19+
// FIX_WHEN_MIN_IS_223
20+
private val commonPlugins223 = commonPlugins.map {
21+
when (it) {
22+
"git4idea" -> "vcs-git"
23+
else -> it
24+
}
25+
}.toTypedArray()
26+
1827
private val ideProfiles = listOf(
1928
Profile(
2029
name = "2021.3",
@@ -75,6 +84,7 @@ object IdeVersions {
7584
// Can remove when https://github.com/JetBrains/gradle-intellij-plugin/issues/608 is fixed
7685
"com.intellij.css",
7786
"JavaScriptDebugger",
87+
"com.jetbrains.codeWithMe",
7888
"com.intellij.database",
7989
"Pythonid:221.5080.212",
8090
"org.jetbrains.plugins.go:221.5080.210"
@@ -92,6 +102,11 @@ object IdeVersions {
92102
),
93103
Profile(
94104
name = "2022.2",
105+
gateway = ProductProfile(
106+
sdkFlavor = IdeFlavor.GW,
107+
sdkVersion = "222.4459-EAP-CANDIDATE-SNAPSHOT",
108+
plugins = arrayOf("org.jetbrains.plugins.terminal")
109+
),
95110
community = ProductProfile(
96111
sdkFlavor = IdeFlavor.IC,
97112
sdkVersion = "2022.2",
@@ -113,6 +128,7 @@ object IdeVersions {
113128
"com.intellij.css",
114129
"JavaScriptDebugger",
115130
"com.intellij.database",
131+
"com.jetbrains.codeWithMe",
116132
"Pythonid:222.3345.118",
117133
"org.jetbrains.plugins.go:222.3345.118",
118134
// https://github.com/JetBrains/gradle-intellij-plugin/issues/1056
@@ -131,10 +147,18 @@ object IdeVersions {
131147
),
132148
Profile(
133149
name = "2022.3",
150+
// allow the next MV so customers potentially don't need to wait for us to deploy new EAP
151+
// also gateway:latest can point to next MV and we don't have a good strategy to support this yet
152+
untilVersion = "224.*",
153+
gateway = ProductProfile(
154+
sdkFlavor = IdeFlavor.GW,
155+
sdkVersion = "223.7571-EAP-CANDIDATE-SNAPSHOT",
156+
plugins = arrayOf("org.jetbrains.plugins.terminal")
157+
),
134158
community = ProductProfile(
135159
sdkFlavor = IdeFlavor.IC,
136160
sdkVersion = "223.7571-EAP-CANDIDATE-SNAPSHOT",
137-
plugins = commonPlugins + listOf(
161+
plugins = commonPlugins223 + listOf(
138162
"java",
139163
"com.intellij.gradle",
140164
"org.jetbrains.idea.maven",
@@ -145,13 +169,14 @@ object IdeVersions {
145169
ultimate = ProductProfile(
146170
sdkFlavor = IdeFlavor.IU,
147171
sdkVersion = "223.7571-EAP-CANDIDATE-SNAPSHOT",
148-
plugins = commonPlugins + listOf(
172+
plugins = commonPlugins223 + listOf(
149173
"JavaScript",
150174
// Transitive dependency needed for javascript
151175
// Can remove when https://github.com/JetBrains/gradle-intellij-plugin/issues/608 is fixed
152176
"com.intellij.css",
153177
"JavaScriptDebugger",
154178
"com.intellij.database",
179+
"com.jetbrains.codeWithMe",
155180
"Pythonid:223.7571.4",
156181
"org.jetbrains.plugins.go:223.7571.4",
157182
// https://github.com/JetBrains/gradle-intellij-plugin/issues/1056
@@ -160,14 +185,14 @@ object IdeVersions {
160185
),
161186
rider = RiderProfile(
162187
sdkVersion = "2022.3-EAP6-SNAPSHOT",
163-
plugins = commonPlugins + listOf(
188+
plugins = commonPlugins223 + listOf(
164189
"rider-plugins-appender" // Workaround for https://youtrack.jetbrains.com/issue/IDEA-179607
165190
),
166191
netFrameworkTarget = "net472",
167192
rdGenVersion = "2022.3.4",
168193
nugetVersion = "2022.3.0-eap06"
169194
)
170-
)
195+
),
171196

172197
).associateBy { it.name }
173198

@@ -183,7 +208,7 @@ object IdeVersions {
183208
open class ProductProfile(
184209
val sdkFlavor: IdeFlavor,
185210
val sdkVersion: String,
186-
val plugins: Array<String>
211+
val plugins: Array<String> = emptyArray()
187212
) {
188213
fun version(): String? = if (!isLocalPath(sdkVersion)) {
189214
sdkFlavor.name + "-" + sdkVersion
@@ -211,6 +236,7 @@ class Profile(
211236
val shortName: String = shortenedIdeProfileName(name),
212237
val sinceVersion: String = shortName,
213238
val untilVersion: String = "$sinceVersion.*",
239+
val gateway: ProductProfile? = null,
214240
val community: ProductProfile,
215241
val ultimate: ProductProfile,
216242
val rider: RiderProfile,

buildSrc/src/main/kotlin/software/aws/toolkits/gradle/intellij/ToolkitIntelliJExtension.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ abstract class ToolkitIntelliJExtension(private val providers: ProviderFactory)
2525
IdeFlavor.IC -> ideProfile().map { it.community }
2626
IdeFlavor.IU -> ideProfile().map { it.ultimate }
2727
IdeFlavor.RD -> ideProfile().map { it.rider }
28+
IdeFlavor.GW -> ideProfile().map { it.gateway!! }
2829
}
2930
}
3031
}

buildSrc/src/main/kotlin/toolkit-intellij-subplugin.gradle.kts

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ import org.eclipse.jgit.api.Git
55
import org.gradle.internal.os.OperatingSystem
66
import org.gradle.testing.jacoco.plugins.JacocoTaskExtension.Output
77
import org.jetbrains.intellij.tasks.DownloadRobotServerPluginTask
8+
import org.jetbrains.intellij.tasks.PatchPluginXmlTask
89
import org.jetbrains.intellij.tasks.RunIdeForUiTestTask
910
import org.jetbrains.intellij.utils.OpenedPackages
11+
import software.aws.toolkits.gradle.buildMetadata
1012
import software.aws.toolkits.gradle.ciOnly
1113
import software.aws.toolkits.gradle.findFolders
1214
import software.aws.toolkits.gradle.intellij.IdeFlavor
@@ -86,40 +88,23 @@ intellij {
8688
plugins.set(toolkitIntelliJ.productProfile().map { it.plugins.toMutableList() })
8789

8890
downloadSources.set(toolkitIntelliJ.ideFlavor.map { it == IdeFlavor.IC && !project.isCi() })
89-
instrumentCode.set(toolkitIntelliJ.ideFlavor.map { it != IdeFlavor.RD })
91+
instrumentCode.set(toolkitIntelliJ.ideFlavor.map { it == IdeFlavor.IC || it == IdeFlavor.IU })
9092
}
9193

9294
tasks.jar {
9395
archiveBaseName.set(toolkitIntelliJ.ideFlavor.map { "aws-toolkit-jetbrains-$it" })
9496
}
9597

96-
tasks.patchPluginXml {
98+
tasks.withType<PatchPluginXmlTask>().all {
9799
sinceBuild.set(toolkitIntelliJ.ideProfile().map { it.sinceVersion })
98100
untilBuild.set(toolkitIntelliJ.ideProfile().map { it.untilVersion })
99101
}
100102

101103
// attach the current commit hash on local builds
102104
if (!project.isCi()){
103-
val buildMetadata = try {
104-
val git = Git.open(project.rootDir)
105-
val currentShortHash = git.repository.findRef("HEAD").objectId.abbreviate(7).name()
106-
val isDirty = git.status().call().hasUncommittedChanges()
107-
108-
buildString {
109-
append(currentShortHash)
110-
111-
if (isDirty) {
112-
append(".modified")
113-
}
114-
}
115-
} catch(e: IOException) {
116-
logger.warn("Could not determine current commit", e)
117-
118-
"unknownCommit"
119-
}
120-
121-
tasks.patchPluginXml {
122-
version.set("${version.get()}+$buildMetadata")
105+
val buildMetadata = buildMetadata()
106+
tasks.withType<PatchPluginXmlTask>().all {
107+
version.set(intellij.version.map { "$it+$buildMetadata" })
123108
}
124109

125110
tasks.buildPlugin {

buildSrc/src/main/kotlin/toolkit-kotlin-conventions.gradle.kts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,11 @@ java {
4949
}
5050

5151
tasks.withType<KotlinCompile>().all {
52-
kotlinOptions.jvmTarget = javaVersion.majorVersion
53-
kotlinOptions.apiVersion = kotlinTarget
52+
kotlinOptions {
53+
jvmTarget = javaVersion.majorVersion
54+
apiVersion = kotlinTarget
55+
freeCompilerArgs = listOf("-Xjvm-default=all")
56+
}
5457
}
5558

5659
tasks.withType<Detekt>().configureEach {

0 commit comments

Comments
 (0)