Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
586ff91
initial setup for scorex CLI
Tim-Tr Jan 15, 2026
c435042
setup init command in scorex cli
Tim-Tr Jan 15, 2026
b6cdf65
added templates for scorex cli
Tim-Tr Jan 15, 2026
70152c1
moved skeleton generation to skeleten_generator.go in scorex cli
Tim-Tr Jan 15, 2026
43ad1e3
made (minimal) working template in scorex cli
Tim-Tr Jan 15, 2026
c2c0616
add bazelversion to template of scorex cli
Tim-Tr Jan 15, 2026
c523411
updated copyiright headers
Tim-Tr Jan 15, 2026
b204d0f
add README.md for scorex cli
Tim-Tr Jan 15, 2026
3d31286
extracted hardcoded values to config.go in scorex cli
Tim-Tr Jan 16, 2026
48fa8c4
add feo and daal applications as seperate templates in scorex cli
Tim-Tr Jan 16, 2026
58ec23a
adapted DAAL example to template in scorex cli
Tim-Tr Jan 19, 2026
274efc8
enhanced module loading in scorex cli
Tim-Tr Jan 19, 2026
5b92516
fixed url with score prefix in scorex cli
Tim-Tr Jan 19, 2026
a0a2d50
fixed inc_daal dependency in scorex cli
Tim-Tr Jan 19, 2026
c7f23ac
add dialog option to init command in scorex cli
Tim-Tr Jan 19, 2026
93aa9fb
add template folder for modules in scorex cli
Tim-Tr Jan 19, 2026
329bfc1
added json config for scorex cli
Tim-Tr Jan 19, 2026
0467138
added feo hello_world app in scorex cli
Tim-Tr Jan 19, 2026
1004ea6
cleaned init.go in scorex cli
Tim-Tr Jan 20, 2026
f233835
refactored scorex cli
Tim-Tr Jan 20, 2026
d69ac95
improved init.go in scorex cli
Tim-Tr Jan 20, 2026
59c3245
add .devcontainer option to daal in scorex cli
Tim-Tr Jan 21, 2026
ee7243d
remove deprecated resolver.go in scorex cli
Tim-Tr Jan 21, 2026
78874ae
enhance module selection in init of scorex cli
Tim-Tr Jan 21, 2026
c381f4c
fixed feo skeleton application in scorex cli
Tim-Tr Jan 21, 2026
628aaee
add module_presets to scorex cli
Tim-Tr Jan 21, 2026
aa8ff49
improved layout of MODULE.bazel templates in scorex cli
Tim-Tr Jan 21, 2026
ffa6b54
adapted .devcontainer from eclipse-score in scorex cli
Tim-Tr Jan 21, 2026
eb9d7a6
fixed .devcontainer template in scorex cli
Tim-Tr Jan 21, 2026
e80d615
added golang build and workflow change
FScholPer Jan 22, 2026
706ff8a
add gazelle generated build files
FScholPer Jan 22, 2026
f656965
fix visibility
FScholPer Jan 22, 2026
a6a7808
readd go.mod
FScholPer Jan 22, 2026
1bb82bd
fixed copyright
FScholPer Jan 22, 2026
643f0cf
added devcontainer
FScholPer Jan 22, 2026
58c0d3d
fixed copyright
FScholPer Jan 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "eclipse-s-core",
"image": "ghcr.io/eclipse-score/devcontainer:v1.1.0"
}
19 changes: 19 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,25 @@ on:
merge_group:
types: [checks_requested]
jobs:
gazelle-and-go-build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.9.0
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true

- name: Run Gazelle
run: bazel run //:gazelle

- name: Build scorex
run: bazel build //scorex:scorex

qnx-build:
uses: eclipse-score/cicd-workflows/.github/workflows/qnx-build.yml@main
permissions:
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@
*.dll

# Fortran module files
*.mod
*.smod

# Go module file exception - allow go.mod files
!go.mod

# Compiled Static libraries
*.lai
*.la
Expand Down
4 changes: 4 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

load("@bazel_gazelle//:def.bzl", "gazelle")
load("@score_docs_as_code//:docs.bzl", "docs")
load("@score_tooling//:defs.bzl", "copyright_checker", "dash_license_checker", "setup_starpls", "use_format_targets")
load("//:project_config.bzl", "PROJECT_CONFIG")

gazelle(name = "gazelle")

setup_starpls(
name = "starpls_server",
visibility = ["//visibility:public"],
Expand All @@ -23,6 +26,7 @@ setup_starpls(
copyright_checker(
name = "copyright",
srcs = [
"scorex",
"src",
"tests",
"//:BUILD",
Expand Down
29 changes: 20 additions & 9 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module(
)

# Configure and register the python toolchain.
bazel_dep(name = "rules_python", version = "1.4.1")
bazel_dep(name = "rules_python", version = "1.5.1")

PYTHON_VERSION = "3.12"

Expand All @@ -25,7 +25,7 @@ python.toolchain(
is_default = True,
python_version = PYTHON_VERSION,
)
use_repo(python)
use_repo(python, "python_versions")

# Configure the target toolchain.
bazel_dep(name = "score_toolchains_qnx", version = "0.0.2", dev_dependency = True)
Expand All @@ -42,16 +42,13 @@ use_repo(qnx, "toolchains_qnx_qcc")
# register_toolchains("@toolchains_qnx_qcc//:qcc_x86_64")

# Add GoogleTest dependency
bazel_dep(name = "googletest", version = "1.17.0")
bazel_dep(name = "googletest", version = "1.17.0.bcr.2")

# Add Rust rules for Rust tests
bazel_dep(name = "rules_rust", version = "0.61.0")

rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
rust.toolchain(edition = "2021")
use_repo(rust, "rust_toolchains")

register_toolchains("@rust_toolchains//:all")

# Add boost dependency
bazel_dep(name = "rules_boost", repo_name = "com_github_nelhage_rules_boost")
Expand All @@ -64,15 +61,16 @@ archive_override(
bazel_dep(name = "boost.program_options", version = "1.87.0")

# C/C++ rules for Bazel
bazel_dep(name = "rules_cc", version = "0.2.1")
bazel_dep(name = "rules_cc", version = "0.2.14")

# tooling
bazel_dep(name = "score_tooling", version = "1.0.2")
bazel_dep(name = "score_tooling", version = "1.0.5")
bazel_dep(name = "aspect_rules_lint", version = "1.5.3")
bazel_dep(name = "buildifier_prebuilt", version = "8.2.0.2")

#docs-as-code
bazel_dep(name = "score_docs_as_code", version = "2.0.2")
bazel_dep(name = "score_docs_as_code", version = "2.3.3")
bazel_dep(name = "score_process", version = "1.4.2")
bazel_dep(name = "score_baselibs", version = "0.1.3")
bazel_dep(name = "score_communication", version = "0.1.1")
bazel_dep(name = "platforms", version = "1.0.0")
Expand All @@ -85,3 +83,16 @@ git_override(
commit = "ede35c4411d41abe42b8f19e78f8989ff79ad3d8",
remote = "https://github.com/bmw-software-engineering/trlc.git",
)

bazel_dep(name = "rules_go", version = "0.59.0")
bazel_dep(name = "gazelle", version = "0.42.0", repo_name = "bazel_gazelle")

go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(version = "1.23.5")

go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//scorex:go.mod")
use_repo(
go_deps,
"com_github_spf13_cobra",
)
36 changes: 36 additions & 0 deletions scorex/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# *******************************************************************************
# Copyright (c) 2026 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
load("@rules_go//go:def.bzl", "go_binary", "go_library")

# gazelle:prefix scorex
exports_files(
[
"go.mod",
"go.sum",
],
visibility = ["//visibility:public"],
)

go_library(
name = "scorex_lib",
srcs = ["main.go"],
importpath = "scorex",
visibility = ["//visibility:private"],
deps = ["//scorex/cmd"],
)

go_binary(
name = "scorex",
embed = [":scorex_lib"],
visibility = ["//visibility:public"],
)
79 changes: 79 additions & 0 deletions scorex/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<div align="center">

```text
|=================================|
| ___ ___ ___ _ __ _____ __ |
| / __|/ __/ _ \| '__/ _ \ \/ / |
| \__ \ (_| (_) | | | __/> < |
| |___/\___\___/|_| \___/_/\_\ |
| |
|=================================|
```

</div>

# scorex

`scorex` is a small CLI helper for generating S-CORE skeleton applications.

It is implemented in Go in [scorex/main.go](scorex/main.go) and uses Cobra for its CLI in
[scorex/cmd/root.go](scorex/cmd/root.go) and [scorex/cmd/init.go](scorex/cmd/init.go).

## Features

- Generate a new S-CORE Bazel project skeleton
- Pre-wire `MODULE.bazel`, `.bazelrc`, `.bazelversion`, `BUILD`, and `src/main.cpp`
- Use a central `known_good.json` to pin module versions and commits

The project layout and files are rendered from the templates in
[scorex/cmd/templates/application](scorex/cmd/templates/application).

## Installation

From the repository root:

```sh
cd scorex
go mod tidy
go build ./...
```

This creates a `scorex` binary in the `scorex/` directory.

## Usage

Show help:

```sh
./scorex --help
```

Generate a new S-CORE project (example):

```sh
./scorex init \
--module score_baselibs \
--module score_communication \
--name my_score_app \
--dir . \
--bazel-version 8.3.0
```

This will create `./my_score_app` with:

- `MODULE.bazel`
- `.bazelrc`
- `.bazelversion`
- `BUILD`
- `src/BUILD`
- `src/main.cpp`

## Options

The `init` command (see [scorex/cmd/init.go](scorex/cmd/init.go)) supports:

- `--module` (repeatable): S-CORE modules to include, e.g. `score_communication`
- `--name`: Name of the generated project (default: `score_app`)
- `--dir`: Target directory where the project is created (default: current directory)
- `--known-good-url`: URL or file path to `known_good.json`
- `--bazel-version`: Bazel version written into `.bazelversion` (default: `8.3.0`)
30 changes: 30 additions & 0 deletions scorex/cmd/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# *******************************************************************************
# Copyright (c) 2026 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
load("@rules_go//go:def.bzl", "go_library")

go_library(
name = "cmd",
srcs = [
"init.go",
"root.go",
],
importpath = "scorex/cmd",
visibility = ["//visibility:public"],
deps = [
"//scorex/internal/config",
"//scorex/internal/model",
"//scorex/internal/service/knowngood",
"//scorex/internal/service/projectinit",
"@com_github_spf13_cobra//:cobra",
],
)
Loading
Loading