diff --git a/build.gradle.kts b/build.gradle.kts index f85b962..ce8e62b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -98,6 +98,8 @@ fun generateTask(taskName: String, incubating: Boolean) { "--template", "/templates/SemanticAttributes.java.j2", "--output", "/output/{{pascal_prefix}}${classPrefix}Attributes.java", "--file-per-group", "root_namespace", + // Space delimited list of root namespaces to excluded (i.e. "foo bar") + "-Dexcluded_namespaces=\"ios\"", "-Dfilter=${filter}", "-DclassPrefix=${classPrefix}", "-Dpkg=$packageNameArg", diff --git a/buildscripts/templates/SemanticAttributes.java.j2 b/buildscripts/templates/SemanticAttributes.java.j2 index f1f38b8..af1e515 100644 --- a/buildscripts/templates/SemanticAttributes.java.j2 +++ b/buildscripts/templates/SemanticAttributes.java.j2 @@ -37,7 +37,8 @@ {%- set filtered_attributes = attributes_and_templates | list %} {%- endif %} {%- set filtered_enums = filtered_attributes | selectattr('is_enum', 'equalto', true) | list %} -{%- if filtered_attributes | count > 0 %} +{%- set excluded_namespaces_list = excluded_namespaces.replace("\"", "").split(' ') %} +{%- if root_namespace not in excluded_namespaces_list and filtered_attributes | count > 0 %} /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 diff --git a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/IosIncubatingAttributes.java b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/IosIncubatingAttributes.java deleted file mode 100644 index f89b801..0000000 --- a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/IosIncubatingAttributes.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright The OpenTelemetry Authors - * SPDX-License-Identifier: Apache-2.0 - */ - -package io.opentelemetry.semconv.incubating; - -import static io.opentelemetry.api.common.AttributeKey.stringKey; - -import io.opentelemetry.api.common.AttributeKey; - -// DO NOT EDIT, this is an Auto-generated file from -// buildscripts/templates/SemanticAttributes.java.j2 -@SuppressWarnings("unused") -public final class IosIncubatingAttributes { - - /** - * This attribute represents the state the application has transitioned into at the occurrence of - * the event. - * - *

Notes: - * - *

- */ - public static final AttributeKey IOS_STATE = stringKey("ios.state"); - - // Enum definitions - /** Values for {@link #IOS_STATE}. */ - public static final class IosStateValues { - /** - * The app has become `active`. Associated with UIKit notification `applicationDidBecomeActive`. - */ - public static final String ACTIVE = "active"; - - /** - * The app is now `inactive`. Associated with UIKit notification `applicationWillResignActive`. - */ - public static final String INACTIVE = "inactive"; - - /** - * The app is now in the background. This value is associated with UIKit notification - * `applicationDidEnterBackground`. - */ - public static final String BACKGROUND = "background"; - - /** - * The app is now in the foreground. This value is associated with UIKit notification - * `applicationWillEnterForeground`. - */ - public static final String FOREGROUND = "foreground"; - - /** - * The app is about to terminate. Associated with UIKit notification `applicationWillTerminate`. - */ - public static final String TERMINATE = "terminate"; - - private IosStateValues() {} - } - - private IosIncubatingAttributes() {} -} diff --git a/semconv-incubating/src/test/java/io/opentelemetry/semconv/incubating/IncubatingAvailabilityTest.java b/semconv-incubating/src/test/java/io/opentelemetry/semconv/incubating/IncubatingAvailabilityTest.java index 2c669a7..18c103a 100644 --- a/semconv-incubating/src/test/java/io/opentelemetry/semconv/incubating/IncubatingAvailabilityTest.java +++ b/semconv-incubating/src/test/java/io/opentelemetry/semconv/incubating/IncubatingAvailabilityTest.java @@ -36,7 +36,6 @@ void available() { isValidClass("io.opentelemetry.semconv.incubating.HerokuIncubatingAttributes"); isValidClass("io.opentelemetry.semconv.incubating.HostIncubatingAttributes"); isValidClass("io.opentelemetry.semconv.incubating.HttpIncubatingAttributes"); - isValidClass("io.opentelemetry.semconv.incubating.IosIncubatingAttributes"); isValidClass("io.opentelemetry.semconv.incubating.JvmIncubatingAttributes"); isValidClass("io.opentelemetry.semconv.incubating.K8sIncubatingAttributes"); isValidClass("io.opentelemetry.semconv.incubating.LogIncubatingAttributes");