aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMark Lobodzinski <mark@lunarg.com>2018-04-11 12:22:03 -0600
committerMark Lobodzinski <mark@lunarg.com>2018-05-11 20:11:02 -0600
commit7d8a24a8af0768b38a8dbb7bfc75357198909408 (patch)
tree587bef4aebb7c2594a503018940e351d7013e801 /scripts
parenta7c036f36a2b39013f4dff81285f95a2914dc67e (diff)
downloadusermoji-7d8a24a8af0768b38a8dbb7bfc75357198909408.tar.xz
repo: Delete glslang files
Change-Id: I42e66cf9dc4a4db7a86bc2f29086fad532b9f629
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/check_toolchain_revisions.sh57
-rw-r--r--scripts/external_revision_generator.py114
2 files changed, 0 insertions, 171 deletions
diff --git a/scripts/check_toolchain_revisions.sh b/scripts/check_toolchain_revisions.sh
deleted file mode 100755
index 10835290..00000000
--- a/scripts/check_toolchain_revisions.sh
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/bin/bash
-
-set -e
-
-# If any tracked revision no longer matches the local revision, blast the extenal toolchain directories
-
-function check_revision()
-{
- echo Checking current revision for $1 in $2
- if [ -d $2/.git ]; then
- current_rev=$(git --git-dir=$2/.git rev-parse HEAD);
- fi
- echo current_rev for $1 is $current_rev;
- tracked_rev=$(cat $3);
- echo tracked_rev for $1 is $tracked_rev;
- if [ "$current_rev" != "$tracked_rev" ]; then
- echo Revisions for $1 do not match.;
- if [ -d external ]; then
- echo Removing current desktop toolchain;
- rm -rf external/*;
- fi
- if [ -d build-android/external ]; then
- echo Removing current android toolchain;
- rm -rf build-android/external/*;
- fi
- echo Done removing toolchains.
- exit 0;
- fi
-}
-
-# Parameters are tool, current git repo location, tracked revision location
-tool=glslang
-dir=external/glslang
-rev=external_revisions/glslang_revision
-check_revision $tool $dir $rev
-
-tool=glslang_android
-dir=build-android/external/glslang
-rev=build-android/glslang_revision_android
-check_revision $tool $dir $rev
-
-tool=spirv-tools_android
-dir=build-android/external/spirv-tools
-rev=build-android/spirv-tools_revision_android
-check_revision $tool $dir $rev
-
-tool=spirv-headers_android
-dir=build-android/external/spirv-tools/external/spirv-headers
-rev=build-android/spirv-headers_revision_android
-check_revision $tool $dir $rev
-
-tool=shaderc_android
-dir=build-android/external/shaderc
-rev=build-android/shaderc_revision_android
-check_revision $tool $dir $rev
-
-exit 0
diff --git a/scripts/external_revision_generator.py b/scripts/external_revision_generator.py
deleted file mode 100644
index 9ba9156b..00000000
--- a/scripts/external_revision_generator.py
+++ /dev/null
@@ -1,114 +0,0 @@
-#!/usr/bin/env python3
-#
-# Copyright (c) 2015-2017 The Khronos Group Inc.
-# Copyright (c) 2015-2017 Valve Corporation
-# Copyright (c) 2015-2017 LunarG, Inc.
-# Copyright (c) 2015-2017 Google Inc.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# Author: Cort Stratton <cort@google.com>
-# Author: Jean-Francois Roy <jfroy@google.com>
-
-import argparse
-import hashlib
-import subprocess
-
-def generate(symbol_name, commit_id, output_header_file):
- # Write commit ID to output header file
- with open(output_header_file, "w") as header_file:
- # File Comment
- file_comment = '// *** THIS FILE IS GENERATED - DO NOT EDIT ***\n'
- file_comment += '// See external_revision_generator.py for modifications\n'
- header_file.write(file_comment)
- # Copyright Notice
- copyright = ''
- copyright += '\n'
- copyright += '/***************************************************************************\n'
- copyright += ' *\n'
- copyright += ' * Copyright (c) 2015-2017 The Khronos Group Inc.\n'
- copyright += ' * Copyright (c) 2015-2017 Valve Corporation\n'
- copyright += ' * Copyright (c) 2015-2017 LunarG, Inc.\n'
- copyright += ' * Copyright (c) 2015-2017 Google Inc.\n'
- copyright += ' *\n'
- copyright += ' * Licensed under the Apache License, Version 2.0 (the "License");\n'
- copyright += ' * you may not use this file except in compliance with the License.\n'
- copyright += ' * You may obtain a copy of the License at\n'
- copyright += ' *\n'
- copyright += ' * http://www.apache.org/licenses/LICENSE-2.0\n'
- copyright += ' *\n'
- copyright += ' * Unless required by applicable law or agreed to in writing, software\n'
- copyright += ' * distributed under the License is distributed on an "AS IS" BASIS,\n'
- copyright += ' * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n'
- copyright += ' * See the License for the specific language governing permissions and\n'
- copyright += ' * limitations under the License.\n'
- copyright += ' *\n'
- copyright += ' * Author: Chris Forbes <chrisforbes@google.com>\n'
- copyright += ' * Author: Cort Stratton <cort@google.com>\n'
- copyright += ' *\n'
- copyright += ' ****************************************************************************/\n'
- header_file.write(copyright)
- # Contents
- contents = '#pragma once\n\n'
- contents += '#define %s "%s"\n' % (symbol_name, commit_id)
- header_file.write(contents)
-
-def get_commit_id_from_git(git_binary, source_dir):
- return subprocess.check_output([git_binary, "rev-parse", "HEAD"], cwd=source_dir).decode('utf-8').strip()
-
-def is_sha1(str):
- try: str_as_int = int(str, 16)
- except ValueError: return False
- return len(str) == 40
-
-def get_commit_id_from_file(rev_file):
- with open(rev_file, 'r') as rev_stream:
- rev_contents = rev_stream.read()
- rev_contents_stripped = rev_contents.strip()
- if is_sha1(rev_contents_stripped):
- return rev_contents_stripped;
- # otherwise, SHA1 the entire (unstripped) file contents
- sha1 = hashlib.sha1();
- sha1.update(rev_contents.encode('utf-8'))
- return sha1.hexdigest()
-
-def main():
- parser = argparse.ArgumentParser()
- parser.add_argument("-s", "--symbol_name", metavar="SYMBOL_NAME", required=True, help="C symbol name")
- parser.add_argument("-o", "--output_header_file", metavar="OUTPUT_HEADER_FILE", required=True, help="output header file path")
- rev_method_group = parser.add_mutually_exclusive_group(required=True)
- rev_method_group.add_argument("--git_dir", metavar="SOURCE_DIR", help="git working copy directory")
- rev_method_group.add_argument("--rev_file", metavar="REVISION_FILE", help="source revision file path (must contain a SHA1 hash")
- args = parser.parse_args()
-
- # We can either parse the latest Git commit ID out of the specified repository (preferred where possible),
- # or computing the SHA1 hash of the contents of a file passed on the command line and (where necessary --
- # e.g. when building the layers outside of a Git environment).
- if args.git_dir is not None:
- # Extract commit ID from the specified source directory
- try:
- commit_id = get_commit_id_from_git('git', args.git_dir)
- except WindowsError:
- # Call git.bat on Windows for compatiblity.
- commit_id = get_commit_id_from_git('git.bat', args.git_dir)
- elif args.rev_file is not None:
- # Read the commit ID from a file.
- commit_id = get_commit_id_from_file(args.rev_file)
-
- if not is_sha1(commit_id):
- raise ValueError("commit ID for " + args.symbol_name + " must be a SHA1 hash.")
-
- generate(args.symbol_name, commit_id, args.output_header_file)
-
-if __name__ == '__main__':
- main()