From 1f73c46010262abddb15db38f15be609c613f3ca Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Sun, 5 Feb 2017 18:23:13 +0000 Subject: [PATCH] Remove the metadata validator from the repository --- .travis.yml | 11 --- CMakeLists.txt | 10 --- README.md | 2 +- appveyor.yml | 16 +--- scripts/archive.js | 25 ------- scripts/helpers.js | 10 --- .../travis/metadata-validator.bintray.json | 15 ---- src/validator/main.cpp | 73 ------------------- 8 files changed, 2 insertions(+), 160 deletions(-) delete mode 100644 scripts/travis/metadata-validator.bintray.json delete mode 100644 src/validator/main.cpp diff --git a/.travis.yml b/.travis.yml index 2d945edb..3d43440b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -82,13 +82,11 @@ after_success: # Need to replace the HEAD branch descriptor in the archive filenames - for ARCHIVE in build/*.tar.xz; do mv $ARCHIVE $(echo $ARCHIVE | sed "s/HEAD/$TRAVIS_BRANCH/"); done # Make copies of the archives for GitHub deployment to find. - - cp $(ls build/metadata-validator_*.tar.xz) build/metadata-validator.tar.xz - cp $(ls build/loot-api_*.tar.xz) build/loot-api.tar.xz # Need to replace the Bintray config files' version placeholders. - VERSION=$(ls build/loot_*.tar.xz | sed 's/build\/loot_//;s/.tar.xz//;') - sed -i "s/REPLACE_THIS_VERSION/$VERSION/" scripts/travis/loot.bintray.json - sed -i "s/REPLACE_THIS_VERSION/$VERSION/" scripts/travis/loot-api.bintray.json - - sed -i "s/REPLACE_THIS_VERSION/$VERSION/" scripts/travis/metadata-validator.bintray.json deploy: - provider: bintray @@ -107,19 +105,10 @@ deploy: skip_cleanup: true on: all_branches: true - - provider: bintray - file: scripts/travis/metadata-validator.bintray.json - user: wrinklyninja - key: - secure: "CyJpCbkO4pK+h4ZFDqwS3FZNwTaY7638IT7uzVKhGQV2CD9nMR7mb9bL6DG/Uxs91MuBeCu8RwzXtK5IVmPkH5AbMO95JMsjor+t8lT6AHhjvgmAhOBXJa5qMbFBFbLQErTdudHIcOxgjyjA5vqt5Zf0DlWty7WnE10WoU/O7qg=" - skip_cleanup: true - on: - all_branches: true - provider: releases api_key: secure: "TuiXR/J5cdvgAXqU5x79E7thXwzN4Jqo1vKolPPb5ahrBllBHFh23awyOIdlTnXY1aS6NjS85uIiD3TNZ/hwrtDsjMgNs1ofL6A9B+7uQJjpK8JqFUECrJCMsEhnwRSzIUeqDeZp440x3c0bTFqfSMErrG/ga5S+VyNYHYREqo4=" file: - - build/metadata-validator.tar.xz - build/loot-api.tar.xz skip_cleanup: true on: diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d7aaf7e..a328f8aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -298,8 +298,6 @@ set (LOOT_API_HEADERS "${CMAKE_SOURCE_DIR}/include/loot/api.h" "${CMAKE_SOURCE_DIR}/include/loot/struct/simple_message.h" "${CMAKE_SOURCE_DIR}/src/api/api_database.h") -set (LOOT_VALIDATOR_SRC "${CMAKE_SOURCE_DIR}/src/validator/main.cpp") - set (LOOT_TESTS_SRC "${CMAKE_SOURCE_DIR}/src/tests/backend/main.cpp") set (LOOT_TESTS_HEADERS # Testing this here rather than as part of the API tests @@ -353,7 +351,6 @@ source_group("Source Files\\gui" FILES ${LOOT_GUI_SRC}) source_group("Source Files\\api" FILES ${LOOT_API_SRC}) source_group("Source Files\\tests" FILES ${LOOT_TESTS_SRC}) source_group("Source Files\\tests" FILES ${LOOT_API_TESTS_SRC}) -source_group("Source Files\\validator" FILES ${LOOT_VALIDATOR_SRC}) # Include source and library directories. include_directories ("${CMAKE_SOURCE_DIR}/src" @@ -447,12 +444,6 @@ add_executable (LOOT ${LOOT_GUI_SRC} ${LOOT_GUI_HEADERS}) add_dependencies (LOOT cef loot_common) target_link_libraries(LOOT ${CEF_LIBRARIES} loot_common ${LOOT_GUI_LIBS}) -# Build validator. -add_executable (metadata-validator ${LOOT_VALIDATOR_SRC}) -add_dependencies (metadata-validator loot_common) -target_link_libraries(metadata-validator loot_common) - - ############################## # Set Target-Specific Flags @@ -472,7 +463,6 @@ IF (CMAKE_SYSTEM_NAME MATCHES "Windows") set_target_properties (loot_common PROPERTIES COMPILE_DEFINITIONS "${COMPILE_DEFINITIONS} LOOT_STATIC") set_target_properties (tests PROPERTIES COMPILE_DEFINITIONS "${COMPILE_DEFINITIONS} LOOT_STATIC") set_target_properties (LOOT PROPERTIES COMPILE_DEFINITIONS "${COMPILE_DEFINITIONS} LOOT_STATIC") - set_target_properties (metadata-validator PROPERTIES COMPILE_DEFINITIONS "${COMPILE_DEFINITIONS} LOOT_STATIC") IF (BUILD_SHARED_LIBS) set_target_properties (loot_api PROPERTIES COMPILE_DEFINITIONS "${COMPILE_DEFINITIONS} LOOT_EXPORT") ELSE () diff --git a/README.md b/README.md index 6b4b7654..123992c4 100644 --- a/README.md +++ b/README.md @@ -67,4 +67,4 @@ Packaging scripts are provided for creating an installer on Windows and compress Run the `scripts/installer.iss` [Inno Setup](http://www.jrsoftware.org/isinfo.php) script to build an installer executable in the `build` folder. The script requires the [Inno Download Plugin](https://bitbucket.org/mitrich_k/inno-download-plugin) to be installed. If the unofficial Korean and Simplified Chinese Inno Setup translation files are installed alongside the official translation files, then the installer script will also offer those language options. If they are not found, the installer will be built without them. -The archive packaging script requires [Git](https://git-scm.com/), and on Windows it also requires [7-Zip](http://7-zip.org), while on Linux it requires `tar` and `xz`. It can be run using `node scripts/archive.js`, and creates archives for LOOT, its API and the metadata validator in the `build` folder. The archives are named as described in the Downloads section above. +The archive packaging script requires [Git](https://git-scm.com/), and on Windows it also requires [7-Zip](http://7-zip.org), while on Linux it requires `tar` and `xz`. It can be run using `node scripts/archive.js`, and creates archives for LOOT and its API in the `build` folder. The archives are named as described in the Downloads section above. diff --git a/appveyor.yml b/appveyor.yml index 84b7ddd5..725dffca 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -84,8 +84,6 @@ artifacts: name: LOOT - path: build\loot-api_$(GIT_DESCRIBE)_$(APPVEYOR_REPO_BRANCH)_$(PLATFORM).7z name: API - - path: build\metadata-validator_$(GIT_DESCRIBE)_$(APPVEYOR_REPO_BRANCH)_$(PLATFORM).7z - name: metadata-validator - path: build\LOOT Installer.exe name: installer @@ -112,17 +110,6 @@ deploy: publish: true artifact: API - - provider: BinTray - username: wrinklyninja - api_key: - secure: fBQJmUDK/EgEUWjjbo6bWcitczeFTJZT4OZ3ZZ4FoUT6soBsTWPQJnr8YEVMFhGP - subject: wrinklyninja - repo: loot - package: metadata-validator - version: $(GIT_DESCRIBE)_$(APPVEYOR_REPO_BRANCH) - publish: true - artifact: metadata-validator - - provider: GitHub tag: $(APPVEYOR_REPO_TAG_NAME) release: LOOT v$(APPVEYOR_REPO_TAG_NAME) @@ -157,7 +144,7 @@ deploy: *Note: The files below with `tar.xz` extensions contain Linux binaries. They won't work on Windows computers.* auth_token: secure: V1GojGQfrAiQtUWtNNXfm3samiH+1yNF5UYhkn8B8mbif20IGTGWNlBS9E4S0SUC - artifact: LOOT,API,metadata-validator,installer + artifact: LOOT,API,installer draft: false force_update: true on: @@ -169,7 +156,6 @@ on_success: if ($env:bintray_auth_token) { python "$env:APPVEYOR_BUILD_FOLDER\delete_old_bintray_versions.py" -o loot -g loot -u wrinklyninja -b loot -p loot -t $env:bintray_auth_token -a $env:github_auth_token -n 30 python "$env:APPVEYOR_BUILD_FOLDER\delete_old_bintray_versions.py" -o loot -g loot -u wrinklyninja -b loot -p loot-api -t $env:bintray_auth_token -a $env:github_auth_token -n 30 - python "$env:APPVEYOR_BUILD_FOLDER\delete_old_bintray_versions.py" -o loot -g loot -u wrinklyninja -b loot -p metadata-validator -t $env:bintray_auth_token -a $env:github_auth_token -n 30 } - ps: scripts\appveyor\update_masterlist_branches.ps1 diff --git a/scripts/archive.js b/scripts/archive.js index 7808d6a9..4a70731c 100644 --- a/scripts/archive.js +++ b/scripts/archive.js @@ -203,23 +203,6 @@ function createApiArchive(rootPath, releasePath, tempPath, destPath) { fs.removeSync(tempPath); } -function createMetadataValidatorArchive(rootPath, binaryPath, tempPath, destPath) { - // Ensure that the output directory is empty. - fs.emptyDirSync(tempPath); - - // Metadata validator binary. - fs.copySync( - binaryPath, - path.join(tempPath, path.basename(binaryPath)) - ); - - // Now compress the folder to a 7-zip archive. - compress(tempPath, destPath); - - // Finally, delete the temporary folder. - fs.removeSync(tempPath); -} - function getFilenameSuffix(label, gitDescription) { if (label) { return `${gitDescription}_${label}`; @@ -261,11 +244,3 @@ helpers.getApiBinaryPaths(rootPath).forEach(binaryPath => { path.join(rootPath, 'build', filename), path.join(rootPath, 'build', filename + fileExtension)); }); - -helpers.getMetadataValidatorBinaryPaths(rootPath).forEach(binaryPath => { - const filename = `metadata-validator_${getFilenameSuffix(binaryPath.label, gitDesc)}`; - createMetadataValidatorArchive(rootPath, - binaryPath.path, - path.join(rootPath, 'build', filename), - path.join(rootPath, 'build', filename + fileExtension)); -}); diff --git a/scripts/helpers.js b/scripts/helpers.js index 491847d3..743401cb 100644 --- a/scripts/helpers.js +++ b/scripts/helpers.js @@ -79,15 +79,6 @@ function getApiBinaryPaths(rootPath) { ); } -function getMetadataValidatorBinaryPaths(rootPath) { - let file = 'metadata-validator'; - if (os.platform() === 'win32') { - file += '.exe'; - } - - return getBinaryPaths(rootPath, file); -} - function safeExecFileSync(file, args, options) { try { return childProcess.execFileSync(file, args, options); @@ -99,5 +90,4 @@ function safeExecFileSync(file, args, options) { module.exports.fileExists = fileExists; module.exports.getAppReleasePaths = getAppReleasePaths; module.exports.getApiBinaryPaths = getApiBinaryPaths; -module.exports.getMetadataValidatorBinaryPaths = getMetadataValidatorBinaryPaths; module.exports.safeExecFileSync = safeExecFileSync; diff --git a/scripts/travis/metadata-validator.bintray.json b/scripts/travis/metadata-validator.bintray.json deleted file mode 100644 index c2f931b5..00000000 --- a/scripts/travis/metadata-validator.bintray.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "package": { - "name": "metadata-validator", - "repo": "loot", - "subject": "wrinklyninja" - }, - "version": { - "name": "REPLACE_THIS_VERSION" - }, - "files": [{ - "includePattern": "build/(metadata-validator_.+\\.tar.xz)", - "uploadPattern": "$1" - }], - "publish": true -} diff --git a/src/validator/main.cpp b/src/validator/main.cpp deleted file mode 100644 index 1c388671..00000000 --- a/src/validator/main.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/* LOOT - - A load order optimisation tool for Oblivion, Skyrim, Fallout 3 and - Fallout: New Vegas. - - Copyright (C) 2014-2016 WrinklyNinja - - This file is part of LOOT. - - LOOT is free software: you can redistribute - it and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation, either version 3 of - the License, or (at your option) any later version. - - LOOT is distributed in the hope that it will - be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with LOOT. If not, see - . - */ - -#include - -#include "loot/loot_version.h" -#include "backend/metadata_list.h" - -int main(int argc, char **argv) { - using std::cout; - using std::endl; - - //Set the locale to get encoding conversions working correctly. - std::locale::global(boost::locale::generator().generate("")); - boost::filesystem::path::imbue(std::locale()); - - //Disable logging or else stdout will get overrun. - boost::log::core::get()->set_logging_enabled(false); - - // Print help text if -h, --help or invalid args are given (including no args). - if (argc != 2 || (strcmp(argv[1], "-h") == 0) || (strcmp(argv[1], "--help") == 0)) { - cout << endl - << "Usage: metadata-validator " << endl << endl - << "Arguments:" << endl << endl - << " " << "" << " " << "The metadata file to validate." << endl - << " " << "-v, --version" << " " << "Prints version information for this utility." << endl - << " " << "-h, --help" << " " << "Prints this help text." << endl << endl; - return 1; - } - - // Print version info if -v or --version are given. - if ((strcmp(argv[1], "-v") == 0) || (strcmp(argv[1], "--version") == 0)) { - cout << endl << "LOOT Metadata Validator" << endl - << "v" << loot::LootVersion::major << "." << loot::LootVersion::minor - << "." << loot::LootVersion::patch << endl - << "build revision " << loot::LootVersion::revision << endl << endl; - return 0; - } - - try { - cout << endl << "Validating metadata file: " << argv[1] << endl << endl; - // Test YAML parsing. - loot::MetadataList metadata; - metadata.Load(argv[1]); - } catch (std::exception& e) { - cout << "ERROR: " << e.what() << endl << endl; - return 1; - } - cout << "SUCCESS!" << endl << endl; - - return 0; -}