Skip to content

Commit

Permalink
Add version number
Browse files Browse the repository at this point in the history
  • Loading branch information
archigup committed Dec 3, 2024
1 parent b90f8f0 commit 0fee286
Show file tree
Hide file tree
Showing 15 changed files with 65 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ if(GGL_IPC_AUTH_DISABLE)
add_compile_definitions(GGL_IPC_AUTH_DISABLE)
endif()

file(READ version GGL_VERSION)
string(STRIP "${GGL_VERSION}" GGL_VERSION)
add_compile_definitions("GGL_VERSION=\"${GGL_VERSION}\"")

add_link_options($<$<NOT:$<CONFIG:Debug>>:-pie>)

add_link_options(
Expand Down
4 changes: 4 additions & 0 deletions fleet-provisioning/bin/fleet-provisioning.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
#include <argp.h>
#include <ggl/error.h>
#include <ggl/log.h>
#include <ggl/version.h>
#include <string.h>

__attribute__((visibility("default"))) const char *argp_program_version
= GGL_VERSION;

static char doc[] = "fleet provisioner -- Executable to automatically "
"provision the device to AWS IOT core";
static const char COMPONENT_NAME[] = "fleet-provisioning";
Expand Down
4 changes: 4 additions & 0 deletions ggconfigd/bin/ggconfigd.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
#include <argp.h>
#include <ggl/buffer.h>
#include <ggl/object.h>
#include <ggl/version.h>
#include <stdlib.h>

__attribute__((visibility("default"))) const char *argp_program_version
= GGL_VERSION;

static char doc[] = "ggconfigd -- Greengrass Nucleus Lite configuration daemon";

static struct argp_option opts[] = {
Expand Down
4 changes: 4 additions & 0 deletions ggdeploymentd/bin/ggdeploymentd.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@
#include <ggl/buffer.h>
#include <ggl/error.h>
#include <ggl/vector.h>
#include <ggl/version.h>
#include <limits.h>
#include <string.h>
#include <stdbool.h>

__attribute__((visibility("default"))) const char *argp_program_version
= GGL_VERSION;

static char doc[]
= "ggdeploymentd -- Greengrass Nucleus Lite deployment daemon";

Expand Down
4 changes: 4 additions & 0 deletions gghealthd/bin/gghealthd.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

#include "bus_server.h"
#include <ggl/error.h>
#include <ggl/version.h>

__attribute__((visibility("default"))) const char *argp_program_version
= GGL_VERSION;

int main(void) {
GglError ret = run_gghealthd();
Expand Down
4 changes: 4 additions & 0 deletions ggipcd/bin/ggipcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
#include "ggipcd.h"
#include <argp.h>
#include <ggl/error.h>
#include <ggl/version.h>

__attribute__((visibility("default"))) const char *argp_program_version
= GGL_VERSION;

static char doc[] = "ggipcd -- Greengrass IPC server for Nucleus Lite";

Expand Down
4 changes: 4 additions & 0 deletions ggl-cli/bin/ggl-cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@
#include <ggl/log.h>
#include <ggl/object.h>
#include <ggl/vector.h>
#include <ggl/version.h>
#include <limits.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>

__attribute__((visibility("default"))) const char *argp_program_version
= GGL_VERSION;

char *command = NULL;
char *recipe_dir = NULL;
char *artifacts_dir = NULL;
Expand Down
4 changes: 4 additions & 0 deletions ggl-config-init/bin/ggl-config-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@
#include <ggl/file.h>
#include <ggl/log.h>
#include <ggl/object.h>
#include <ggl/version.h>
#include <ggl/yaml_decode.h>
#include <stddef.h>
#include <stdint.h>

__attribute__((visibility("default"))) const char *argp_program_version
= GGL_VERSION;

static char *config_path = NULL;

static char doc[]
Expand Down
17 changes: 17 additions & 0 deletions ggl-lib/include/ggl/version.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// aws-greengrass-lite - AWS IoT Greengrass runtime for constrained devices
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

// IWYU removes this since GGL_VERSION is provided on the command line
// IWYU pragma: always_keep

#ifndef GGL_VERSION_H
#define GGL_VERSION_H

//! Greengrass Lite version number

#ifndef GGL_VERSION
#define GGL_VERSION "0.0.0"
#endif

#endif
4 changes: 4 additions & 0 deletions ggpubsubd/bin/ggpubsubd.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@
#include "ggpubsubd.h"
#include <argp.h>
#include <ggl/error.h>
#include <ggl/version.h>
#include <stdlib.h>

__attribute__((visibility("default"))) const char *argp_program_version
= GGL_VERSION;

static char doc[] = "ggpubsubd -- Greengrass Publish/Subscribe daemon";

static struct argp_option opts[] = {
Expand Down
4 changes: 4 additions & 0 deletions iotcored/bin/iotcored.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
#include "iotcored.h"
#include <argp.h>
#include <ggl/error.h>
#include <ggl/version.h>

__attribute__((visibility("default"))) const char *argp_program_version
= GGL_VERSION;

static char doc[] = "iotcored -- MQTT spooler for AWS IoT Core";

Expand Down
1 change: 1 addition & 0 deletions nix/withOverlays.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ in
".clang-tidy"
"CMakeLists.txt"
"fc_deps.json"
"version"
"run_nucleus"
"recipe.yml"
"greengrass-lite.target"
Expand Down
4 changes: 4 additions & 0 deletions recipe-runner/bin/recipe-runner.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@
#include "recipe-runner.h"
#include <argp.h>
#include <ggl/error.h>
#include <ggl/version.h>
#include <stdlib.h>

__attribute__((visibility("default"))) const char *argp_program_version
= GGL_VERSION;

static char doc[] = "recipe-runner -- Launch a Greengrass recipe file";

static struct argp_option opts[] = {
Expand Down
3 changes: 2 additions & 1 deletion recipe-runner/src/runner.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <ggl/log.h>
#include <ggl/object.h>
#include <ggl/vector.h>
#include <ggl/version.h>
#include <limits.h>
#include <unistd.h>
#include <stdbool.h>
Expand Down Expand Up @@ -419,7 +420,7 @@ GglError runner(const RecipeRunnerArgs *args) {
}
}

sys_ret = setenv("GGC_VERSION", "0.0.1", true);
sys_ret = setenv("GGC_VERSION", GGL_VERSION, true);
if (sys_ret != 0) {
GGL_LOGE("setenv failed: %d.", errno);
}
Expand Down
1 change: 1 addition & 0 deletions version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.0

0 comments on commit 0fee286

Please sign in to comment.