mirror of
https://github.com/Kitware/CMake.git
synced 2026-06-24 16:58:07 +00:00
instrumentation: Bump data version to 1.2
Raise the maximum supported data version and the version CMake writes in its snippet files from 1.1 to 1.2.
This commit is contained in:
@@ -234,7 +234,7 @@ version will be generated and sent to the user `Callbacks`_ defined in that
|
||||
query.
|
||||
|
||||
Currently, the only supported major version is ``1``, and the maximum supported
|
||||
minor version is also ``1``. A new major version number will be created whenever
|
||||
minor version is ``2``. A new major version number will be created whenever
|
||||
previously included data is removed or reformatted such that scripts written to
|
||||
parse this data may become incompatible with the new format. A new minor version
|
||||
number will be created whenever new data becomes available.
|
||||
|
||||
@@ -49,7 +49,8 @@
|
||||
"type": "integer",
|
||||
"enum": [
|
||||
0,
|
||||
1
|
||||
1,
|
||||
2
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
@@ -24,7 +24,8 @@
|
||||
"type": "integer",
|
||||
"enum": [
|
||||
0,
|
||||
1
|
||||
1,
|
||||
2
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/snippetV1_1"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/snippetV1_2"
|
||||
}
|
||||
],
|
||||
"definitions": {
|
||||
@@ -192,6 +195,24 @@
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"versionV1_2": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"major",
|
||||
"minor"
|
||||
],
|
||||
"properties": {
|
||||
"major": {
|
||||
"type": "integer",
|
||||
"const": 1
|
||||
},
|
||||
"minor": {
|
||||
"type": "integer",
|
||||
"const": 2
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"fields": {
|
||||
"command": {
|
||||
"type": "string",
|
||||
@@ -522,6 +543,88 @@
|
||||
"$ref": "#/definitions/snippetConditionals"
|
||||
}
|
||||
]
|
||||
},
|
||||
"snippetV1_2": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"version",
|
||||
"role",
|
||||
"result",
|
||||
"timeStart",
|
||||
"duration",
|
||||
"workingDir"
|
||||
],
|
||||
"properties": {
|
||||
"version": {
|
||||
"$ref": "#/definitions/versionV1_2"
|
||||
},
|
||||
"command": {
|
||||
"$ref": "#/definitions/fields/command"
|
||||
},
|
||||
"workingDir": {
|
||||
"$ref": "#/definitions/fields/workingDir"
|
||||
},
|
||||
"result": {
|
||||
"$ref": "#/definitions/fields/result"
|
||||
},
|
||||
"role": {
|
||||
"$ref": "#/definitions/fields/role"
|
||||
},
|
||||
"target": {
|
||||
"$ref": "#/definitions/fields/target"
|
||||
},
|
||||
"targetLabels": {
|
||||
"$ref": "#/definitions/fields/targetLabels"
|
||||
},
|
||||
"timeStart": {
|
||||
"$ref": "#/definitions/fields/timeStart"
|
||||
},
|
||||
"duration": {
|
||||
"$ref": "#/definitions/fields/duration"
|
||||
},
|
||||
"outputs": {
|
||||
"$ref": "#/definitions/fields/outputs"
|
||||
},
|
||||
"outputSizes": {
|
||||
"$ref": "#/definitions/fields/outputSizes"
|
||||
},
|
||||
"source": {
|
||||
"$ref": "#/definitions/fields/source"
|
||||
},
|
||||
"language": {
|
||||
"$ref": "#/definitions/fields/language"
|
||||
},
|
||||
"testName": {
|
||||
"$ref": "#/definitions/fields/testName"
|
||||
},
|
||||
"config": {
|
||||
"$ref": "#/definitions/fields/config"
|
||||
},
|
||||
"dynamicSystemInformation": {
|
||||
"$ref": "#/definitions/fields/dynamicSystemInformation"
|
||||
},
|
||||
"cmakeContent": {
|
||||
"$ref": "#/definitions/fields/cmakeContent"
|
||||
},
|
||||
"showOnly": {
|
||||
"$ref": "#/definitions/fields/showOnly"
|
||||
},
|
||||
"stderr": {
|
||||
"$ref": "#/definitions/fields/stderr"
|
||||
},
|
||||
"stdout": {
|
||||
"$ref": "#/definitions/fields/stdout"
|
||||
},
|
||||
"traceFile": {
|
||||
"$ref": "#/definitions/fields/traceFile"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/snippetConditionals"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ bool validateDataVersion(std::string const& versionString, Version& version,
|
||||
if (!cmInstrumentationQuery::ValidDataVersion(version)) {
|
||||
status.SetError(
|
||||
cmStrCat("given an unsupported DATA_VERSION \"", versionString,
|
||||
"\" (the maximum currently supported version is 1.1)."));
|
||||
"\" (the maximum currently supported version is 1.2)."));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -173,6 +173,6 @@ Version cmInstrumentationQuery::LatestDataVersion()
|
||||
{
|
||||
Version latest;
|
||||
latest.Major = 1;
|
||||
latest.Minor = 1;
|
||||
latest.Minor = 2;
|
||||
return latest;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ foreach(content_file IN LISTS content_files)
|
||||
# Check version
|
||||
string(JSON version GET "${contents}" version)
|
||||
json_assert_key("${content_file}" "${version}" major "1")
|
||||
json_assert_key("${content_file}" "${version}" minor "1")
|
||||
json_assert_key("${content_file}" "${version}" minor "2")
|
||||
|
||||
# Check project name
|
||||
json_assert_key("${content_file}" "${contents}" project "instrumentation")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
CMake Error at [^
|
||||
]*\(cmake_instrumentation\):
|
||||
cmake_instrumentation given an unsupported DATA_VERSION "2\.1" \(the maximum
|
||||
currently supported version is 1\.1\)\.
|
||||
currently supported version is 1\.2\)\.
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists\.txt:5 \(include\)
|
||||
|
||||
@@ -68,8 +68,8 @@ json_has_key("${index}" "${contents}" version)
|
||||
|
||||
string(JSON version_major GET "${contents}" version major)
|
||||
string(JSON version_minor GET "${contents}" version minor)
|
||||
if (NOT version_major EQUAL 1 OR NOT version_minor LESS_EQUAL 1)
|
||||
add_error("Version must be <= 1.1, got: ${version_major}.${version_minor}")
|
||||
if (NOT version_major EQUAL 1 OR NOT version_minor LESS_EQUAL 2)
|
||||
add_error("Version must be <= 1.2, got: ${version_major}.${version_minor}")
|
||||
endif()
|
||||
|
||||
json_has_key("${index}" "${contents}" buildDir)
|
||||
|
||||
@@ -78,8 +78,8 @@ function(verify_snippet_data snippet contents)
|
||||
snippet_valid_timing("${contents}")
|
||||
string(JSON version_major GET "${contents}" version major)
|
||||
string(JSON version_minor GET "${contents}" version minor)
|
||||
if (NOT version_major EQUAL 1 OR NOT version_minor LESS_EQUAL 1)
|
||||
json_error("${snippet}" "Version must be <= 1.1, got: ${version_major}.${version_minor}")
|
||||
if (NOT version_major EQUAL 1 OR NOT version_minor LESS_EQUAL 2)
|
||||
json_error("${snippet}" "Version must be <= 1.2, got: ${version_major}.${version_minor}")
|
||||
endif()
|
||||
get_filename_component(filename "${snippet}" NAME)
|
||||
string(JSON result GET "${contents}" result)
|
||||
|
||||
Reference in New Issue
Block a user