Skip to content

Commit 3d653f9

Browse files
author
Andrea Falzetti
committed
feat(jetbrains): add rider and clion
1 parent cd144de commit 3d653f9

File tree

36 files changed

+945
-30
lines changed

36 files changed

+945
-30
lines changed

.github/workflows/jetbrains-auto-update-template.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ jobs:
5757
echo $IDE_VERSION
5858
- name: Leeway build
5959
if: ${{ steps.ide-version.outputs.result }}
60+
env:
61+
LEEWAY_MAX_PROVENANCE_BUNDLE_SIZE: '8388608'
6062
run: |
6163
gcloud auth configure-docker --quiet
6264
export LEEWAY_WORKSPACE_ROOT=$(pwd)

.github/workflows/jetbrains-auto-update.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,21 @@ jobs:
6565
projectId: ${{ secrets.GCP_PROJECT_ID }}
6666
serviceAccountKey: ${{ secrets.GCP_SA_KEY }}
6767
slackWebhook: ${{ secrets.IDE_SLACK_WEBHOOK }}
68+
rider:
69+
uses: ./.github/workflows/jetbrains-auto-update-template.yml
70+
with:
71+
productId: rider
72+
productCode: RD
73+
secrets:
74+
projectId: ${{ secrets.GCP_PROJECT_ID }}
75+
serviceAccountKey: ${{ secrets.GCP_SA_KEY }}
76+
slackWebhook: ${{ secrets.IDE_SLACK_WEBHOOK }}
77+
clion:
78+
uses: ./.github/workflows/jetbrains-auto-update-template.yml
79+
with:
80+
productId: clion
81+
productCode: CL
82+
secrets:
83+
projectId: ${{ secrets.GCP_PROJECT_ID }}
84+
serviceAccountKey: ${{ secrets.GCP_SA_KEY }}
85+
slackWebhook: ${{ secrets.IDE_SLACK_WEBHOOK }}

WORKSPACE.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ defaultArgs:
1717
phpstormDownloadUrl: "https://download.jetbrains.com/webide/PhpStorm-2022.2.3.tar.gz"
1818
rubymineDownloadUrl: "https://download.jetbrains.com/ruby/RubyMine-2022.2.3.tar.gz"
1919
webstormDownloadUrl: "https://download.jetbrains.com/webstorm/WebStorm-2022.2.3.tar.gz"
20+
riderDownloadUrl: "https://download.jetbrains.com/rider/JetBrains.Rider-2022.2.3.tar.gz"
21+
clionDownloadUrl: "https://download.jetbrains.com/cpp/CLion-2022.2.3.tar.gz"
2022
REPLICATED_API_TOKEN: ""
2123
REPLICATED_APP: ""
2224
provenance:

components/BUILD.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ packages:
5454
- components/ide/jetbrains/image:rubymine-latest
5555
- components/ide/jetbrains/image:webstorm
5656
- components/ide/jetbrains/image:webstorm-latest
57+
- components/ide/jetbrains/image:rider
58+
- components/ide/jetbrains/image:rider-latest
59+
- components/ide/jetbrains/image:clion
60+
- components/ide/jetbrains/image:clion-latest
5761
- components/image-builder-bob:docker
5862
- components/image-builder-mk3:docker
5963
- components/local-app:docker

components/dashboard/src/settings/SelectIDE.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export default function SelectIDE(props: SelectIDEProps) {
9292
<>
9393
{allIdeOptions && (
9494
<>
95-
<div className={`my-4 gap-3 flex flex-wrap max-w-2xl`}>
95+
<div className={`my-4 gap-3 flex flex-wrap max-w-3xl`}>
9696
{allIdeOptions.map(([id, option]) => {
9797
const selected = defaultIde === id;
9898
const onSelect = () => actuallySetDefaultIde(id);

components/dashboard/src/settings/SelectIDEModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default function (props: SelectIDEModalProps) {
4444
visible={visible}
4545
onClose={handleContinue}
4646
closeable={true}
47-
className="max-w-2xl"
47+
className="max-w-51.5"
4848
buttons={<button onClick={handleContinue}>Continue</button>}
4949
>
5050
<p className="text-gray-500 dark:text-gray-400 text-base pb-3">

components/dashboard/tailwind.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ module.exports = {
4242
112: "28rem",
4343
128: "32rem",
4444
},
45+
maxWidth: {
46+
// TODO(andreafalzetti): remove custom ide-modal class once we implement https://github.com/gitpod-io/gitpod/issues/13116
47+
51.5: "51.5rem",
48+
},
4549
},
4650
fontFamily: {
4751
sans: [

components/gitpod-protocol/data/gitpod-schema.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,14 @@
283283
"webstorm": {
284284
"$ref": "#/definitions/jetbrainsProduct",
285285
"description": "Configure WebStorm integration"
286+
},
287+
"rider": {
288+
"$ref": "#/definitions/jetbrainsProduct",
289+
"description": "Configure Rider integration"
290+
},
291+
"clion": {
292+
"$ref": "#/definitions/jetbrainsProduct",
293+
"description": "Configure CLion integration"
286294
}
287295
}
288296
},

components/gitpod-protocol/go/gitpod-config-types.go

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/gitpod-protocol/src/protocol.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,8 @@ export interface JetBrainsConfig {
801801
phpstorm?: JetBrainsProductConfig;
802802
rubymine?: JetBrainsProductConfig;
803803
webstorm?: JetBrainsProductConfig;
804+
rider?: JetBrainsProductConfig;
805+
clion?: JetBrainsProductConfig;
804806
}
805807
export interface JetBrainsProductConfig {
806808
prebuilds?: JetBrainsPrebuilds;
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading

components/ide/jetbrains/image/BUILD.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ const ideConfigs = [
2727
name: "webstorm",
2828
productCode: "WS",
2929
},
30+
{
31+
name: "rider",
32+
productCode: "RD",
33+
},
34+
{
35+
name: "clion",
36+
productCode: "CL",
37+
},
3038
];
3139

3240
const packages = [];

components/ide/jetbrains/image/gha-update-image/index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,20 @@ const IDEs = [
4949
productType: "release",
5050
exampleRepo: "https://github.com/gitpod-io/template-jetbrains-webstorm",
5151
},
52+
{
53+
productName: "Rider",
54+
productId: "rider",
55+
productCode: "RD",
56+
productType: "release",
57+
exampleRepo: "https://github.com/gitpod-io/template-dotnet-core-cli-csharp",
58+
},
59+
{
60+
productName: "CLion",
61+
productId: "clion",
62+
productCode: "CL",
63+
productType: "release",
64+
exampleRepo: "https://github.com/gitpod-io/template-cpp",
65+
},
5266
];
5367

5468
(async () => {

components/ide/jetbrains/image/hot-deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ echo "Image Version: $version"
3131
bldfn="/tmp/build-$version.tar.gz"
3232

3333
docker ps &> /dev/null || (echo "You need a working Docker daemon. Maybe set DOCKER_HOST?"; exit 1)
34-
leeway build -Dversion="$version" -DimageRepoBase=eu.gcr.io/gitpod-core-dev/build ".:$component" --save "$bldfn" --dont-retag
34+
leeway build -Dversion="$version" -DimageRepoBase=eu.gcr.io/gitpod-core-dev/build ".:$component" --save "$bldfn"
3535
dev_image="$(tar xfO "$bldfn" ./imgnames.txt | head -n1)"
3636
echo "Dev Image: $dev_image"
3737

components/ide/jetbrains/image/status/main.go

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2022 Gitpod GmbH. All rights reserved.
1+
// Copyright (c) 2021 Gitpod GmbH. All rights reserved.
22
// Licensed under the GNU Affero General Public License (AGPL).
33
// See License-AGPL.txt in the project root for license information.
44

@@ -18,6 +18,7 @@ import (
1818
"os/signal"
1919
"path/filepath"
2020
"reflect"
21+
"regexp"
2122
"strconv"
2223
"strings"
2324
"syscall"
@@ -56,6 +57,50 @@ type LaunchContext struct {
5657
wsInfo *supervisor.WorkspaceInfoResponse
5758
}
5859

60+
func findRiderSolutionFile(root string) (string, error) {
61+
slnRegEx := regexp.MustCompile(`^.+\.sln$`)
62+
projRegEx := regexp.MustCompile(`^.+\.csproj$`)
63+
64+
var slnFiles []string
65+
var csprojFiles []string
66+
67+
err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
68+
if err != nil {
69+
return err
70+
} else if slnRegEx.MatchString(info.Name()) {
71+
slnFiles = append(slnFiles, path)
72+
} else if projRegEx.MatchString(info.Name()) {
73+
csprojFiles = append(csprojFiles, path)
74+
}
75+
return nil
76+
})
77+
78+
if err != nil {
79+
return "", err
80+
}
81+
82+
if len(slnFiles) > 0 {
83+
return slnFiles[0], nil
84+
} else if len(csprojFiles) > 0 {
85+
return csprojFiles[0], nil
86+
}
87+
88+
return root, nil
89+
}
90+
91+
func resolveProjectDir(launchCtx *LaunchContext) string {
92+
if launchCtx.alias == "rider" {
93+
solutionFile, err := findRiderSolutionFile(launchCtx.projectDir)
94+
if err == nil {
95+
return solutionFile
96+
}
97+
log.WithError(err).Error("failed to find a rider solution file")
98+
99+
}
100+
101+
return launchCtx.projectDir
102+
}
103+
59104
// JB startup entrypoint
60105
func main() {
61106
log.Init(ServiceName, Version, true, false)
@@ -362,7 +407,7 @@ func resolveWorkspaceInfo(ctx context.Context) (*supervisor.WorkspaceInfoRespons
362407
func run(launchCtx *LaunchContext) {
363408
var args []string
364409
args = append(args, "run")
365-
args = append(args, launchCtx.projectDir)
410+
args = append(args, resolveProjectDir(launchCtx))
366411
cmd := remoteDevServerCmd(args, launchCtx)
367412
cmd.Env = append(cmd.Env, "JETBRAINS_GITPOD_BACKEND_KIND="+launchCtx.alias)
368413
workspaceUrl, err := url.Parse(launchCtx.wsInfo.WorkspaceUrl)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"entrypoint": "/ide-desktop/startup.sh",
3+
"entrypointArgs": [ "{DESKTOPIDEPORT}", "clion", "Open in CLion" ],
4+
"readinessProbe": {
5+
"type": "http",
6+
"http": {
7+
"path": "/status"
8+
}
9+
}
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"entrypoint": "/ide-desktop/startup.sh",
3+
"entrypointArgs": [ "{DESKTOPIDEPORT}", "rider", "Open in Rider" ],
4+
"readinessProbe": {
5+
"type": "http",
6+
"http": {
7+
"path": "/status"
8+
}
9+
}
10+
}

components/server/src/ide-service.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ export class IDEService {
5959
productCode = "RM";
6060
} else if (key === "webstorm") {
6161
productCode = "WS";
62+
} else if (key === "rider") {
63+
productCode = "RD";
64+
} else if (key === "clion") {
65+
productCode = "CL";
6266
}
6367
const prebuilds = productCode && ws.config.jetbrains[key as keyof JetBrainsConfig]?.prebuilds;
6468
if (prebuilds) {

0 commit comments

Comments
 (0)