Skip to content

Commit

Permalink
chore: optimize project configuration (#58)
Browse files Browse the repository at this point in the history
* chore: fix and simlify devcontainer

Signed-off-by: msclock <msclock@qq.com>

* chore: simplify .editorconfig

Signed-off-by: msclock <msclock@qq.com>

* chore: optimize dependencies declaration

Signed-off-by: msclock <msclock@qq.com>

---------

Signed-off-by: msclock <msclock@qq.com>
  • Loading branch information
msclock committed Mar 5, 2024
1 parent ec84dd5 commit 03afcf8
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 35 deletions.
5 changes: 2 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.195.0/containers/cpp
// https://github.com/devcontainers/images/tree/main/src/base-ubuntu
{
"name": "ss-cpp",
"image": "mcr.microsoft.com/devcontainers/base:jammy",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"capAdd": [
// Enable ptrace-based debugging for C++
"SYS_PTRACE"
Expand All @@ -18,7 +18,6 @@
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/python:1": {},
"ghcr.io/dhoeric/features/act:1": {},
"ghcr.io/msclock/features/vcpkg:1": {},
"ghcr.io/devcontainers/features/common-utils:2": {
"username": "vscode"
Expand Down
5 changes: 1 addition & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,11 @@ indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.{yml,yaml,json,toml,jinja,css,js}]
[*.{yml,yaml,json,toml,jinja,css,js,cmake}]
indent_size = 2

[CMakeLists.txt]
indent_size = 2

[*.cmake]
indent_size = 2

[Makefile]
indent_style = tab
5 changes: 1 addition & 4 deletions template/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,11 @@ indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.{yml,yaml,json,toml,jinja,css,js}]
[*.{yml,yaml,json,toml,jinja,css,js,cmake}]
indent_size = 2

[CMakeLists.txt]
indent_size = 2

[*.cmake]
indent_size = 2

[Makefile]
indent_style = tab
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.195.0/containers/cpp
// https://github.com/devcontainers/images/tree/main/src/base-ubuntu
{
"name": "{{ repo_name }}",
"image": "mcr.microsoft.com/devcontainers/base:jammy",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"capAdd": [
// Enable ptrace-based debugging for C++
"SYS_PTRACE"
Expand All @@ -18,7 +18,6 @@
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/python:1": {},
"ghcr.io/dhoeric/features/act:1": {},
"ghcr.io/msclock/features/vcpkg:1": {},
"ghcr.io/devcontainers/features/common-utils:2": {
"username": "vscode"
Expand Down
42 changes: 29 additions & 13 deletions template/vcpkg.json.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,62 @@
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"name": "{{ repo_name }}",
"description": "{{ project_description }}",
"builtin-baseline": "fe1e9f508ee13ed3d0a7d318beac7efe1ec4f9d7",
"builtin-baseline": "80403036a665cb8fcc1a1b3e17593d20b03b2489",
"dependencies": [
[%- if add_compile_target == true or add_executable_target == true or add_header_only_target == true %]
"abseil",
[%- endif %]
[%- if add_compile_target == true %]
"proxy",
[%- endif %]
[%- if use_conan == true %]
"cmake-conan",
[%- endif %]
[%- if use_cpm == true %]
"cmake-cpm",
[%- endif %]
"cmake-modules",
"robotology-cmake-ycm"
],
"overrides": [
[%- if add_compile_target == true or add_executable_target == true or add_header_only_target == true %]
{
"name": "abseil",
"version>=": "20230802.1"
"version": "20230802.1"
},
[%- endif %]
[%- if add_compile_target == true %]
{
"name": "proxy",
"version": "1.1.1"
},
[%- endif %]
[%- if use_conan == true %]
{
"name": "cmake-conan",
"version>=": "0.18.1"
"version": "0.18.1"
},
[%- endif %]
[%- if use_cpm == true %]
{
"name": "cmake-cpm",
"version>=": "0.38.6#2"
"version": "0.38.6#2"
},
[%- endif %]
{
"name": "cmake-modules",
"version>=": "1.3.0"
"version": "1.3.0"
},
[%- if add_compile_target == true %]
{
"name": "proxy",
"version>=": "1.1.1"
},
[%- endif %]
{
"name": "robotology-cmake-ycm",
"version>=": "0.15.3"
"version": "0.15.3"
}
],
"vcpkg-configuration": {
"registries": [
{
"kind": "git",
"baseline": "fd59f49af83f752d715a1c3d75fa06c658c40eb7",
"baseline": "b58077c46126bee7c5cd54c26a4b974055c21d2b",
"repository": "https://github.com/msclock/cmake-registry",
"packages": [
[%- if use_conan == true %]
Expand Down
22 changes: 14 additions & 8 deletions vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,36 @@
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"name": "ss-cpp",
"description": "A development-focused Cpp project template.",
"builtin-baseline": "fe1e9f508ee13ed3d0a7d318beac7efe1ec4f9d7",
"builtin-baseline": "80403036a665cb8fcc1a1b3e17593d20b03b2489",
"dependencies": [
"abseil",
"proxy",
"cmake-modules",
"robotology-cmake-ycm"
],
"overrides": [
{
"name": "abseil",
"version>=": "20230802.1"
"version": "20230802.1"
},
{
"name": "cmake-modules",
"version>=": "1.3.0"
"name": "proxy",
"version": "1.1.1"
},
{
"name": "proxy",
"version>=": "1.1.1"
"name": "cmake-modules",
"version": "1.3.0"
},
{
"name": "robotology-cmake-ycm",
"version>=": "0.15.3"
"version": "0.15.3"
}
],
"vcpkg-configuration": {
"registries": [
{
"kind": "git",
"baseline": "fd59f49af83f752d715a1c3d75fa06c658c40eb7",
"baseline": "b58077c46126bee7c5cd54c26a4b974055c21d2b",
"repository": "https://github.com/msclock/cmake-registry",
"packages": [
"cmake-modules",
Expand Down

0 comments on commit 03afcf8

Please sign in to comment.