33SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
44ROOT_DIR=" ${SCRIPT_DIR} /../../"
55
6- # freeze the spec version to make SemanticAttributes generation reproducible
7- SPEC_VERSION=v1.7.0
6+ # freeze the spec & generator tools versions to make SemanticAttributes generation reproducible
7+
8+ # repository: https://github.com/open-telemetry/opentelemetry-specification
9+ SEMCONV_VERSION=1.20.0
10+ SPEC_VERSION=v$SEMCONV_VERSION
11+
12+ # repository: https://github.com/open-telemetry/build-tools
13+ GENERATOR_VERSION=0.18.0
814
915cd ${SCRIPT_DIR}
1016
@@ -19,26 +25,28 @@ git reset --hard FETCH_HEAD
1925cd ${SCRIPT_DIR}
2026
2127docker run --rm \
22- -v ${SCRIPT_DIR} /opentelemetry-specification/semantic_conventions/trace :/source \
28+ -v ${SCRIPT_DIR} /opentelemetry-specification/semantic_conventions:/source \
2329 -v ${SCRIPT_DIR} /templates:/templates \
2430 -v ${ROOT_DIR} /Sources/OpenTelemetryApi/Trace/:/output \
25- otel/semconvgen:0.8.0 \
26- --yaml-root /source \
27- code \
31+ otel/semconvgen:$GENERATOR_VERSION \
32+ --only span,event,attribute_group,scope \
33+ -f /source code \
2834 --template /templates/SemanticAttributes.swift.j2 \
2935 --output /output/SemanticAttributes.swift \
30- -Denum=SemanticAttributes \
36+ -Dsemconv=trace \
37+ -Denum=SemanticAttributes
3138
3239docker run --rm \
33- -v ${SCRIPT_DIR} /opentelemetry-specification/semantic_conventions/resource :/source \
40+ -v ${SCRIPT_DIR} /opentelemetry-specification/semantic_conventions:/source \
3441 -v ${SCRIPT_DIR} /templates:/templates \
3542 -v ${ROOT_DIR} /Sources/OpenTelemetrySdk/Resources/:/output \
36- otel/semconvgen:0.8.0 \
37- --yaml-root /source \
38- code \
43+ otel/semconvgen:$GENERATOR_VERSION \
44+ --only resource \
45+ -f /source code \
3946 --template /templates/SemanticAttributes.swift.j2 \
4047 --output /output/ResourceAttributes.swift \
41- -Denum=ResourceAttributes \
48+ -Dsemconv=resource \
49+ -Denum=ResourceAttributes
4250
4351cd " $ROOT_DIR "
4452
0 commit comments