C_INCLUDES must be under the source or output directories:

本文介绍了一个编译过程中遇到的问题及解决方案。主要问题是由于使用了绝对路径导致编译失败,通过调整为相对路径后,问题得到解决。

https://blog.youkuaiyun.com/cigogo/article/details/94546032

参考了上面大神的链接,发现设置了绝对路径,改为相对路径后,正常。

编译报错:

LOCAL_PATH := $(abspath $(call my-dir)/../..)

CAMX_CHICDK_PATH := $(abspath $(LOCAL_PATH)/../../..)

正常:

LOCAL_PATH := $(call my-dir)/../..

CAMX_CHICDK_PATH := $(LOCAL_PATH)/../../..

# # Copyright 2017 The Abseil Authors. # # 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 # # https://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. # # https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md # As of 2024-07-01, CMake 3.16 is the minimum supported version. cmake_minimum_required(VERSION 3.16) # Allow the user to specify the CMAKE_MSVC_DEBUG_INFORMATION_FORMAT if (POLICY CMP0141) cmake_policy(SET CMP0141 NEW) endif (POLICY CMP0141) project(absl LANGUAGES CXX) set(ABSL_SOVERSION 0) include(CTest) # Output directory is correct by default for most build setups. However, when # building Abseil as a DLL, it is important to have the DLL in the same # directory as the executable using it. Thus, we put all executables in a single # /bin directory. set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) # when absl is included as subproject (i.e. using add_subdirectory(abseil-cpp)) # in the source tree of a project that uses it, install rules are disabled. if(NOT CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR) option(ABSL_ENABLE_INSTALL "Enable install rule" OFF) else() option(ABSL_ENABLE_INSTALL "Enable install rule" ON) endif() set(CMAKE_INSTALL_RPATH "$ORIGIN") set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON) set(CMAKE_BUILD_RPATH_USE_ORIGIN ON) option(ABSL_PROPAGATE_CXX_STD "Use CMake C++ standard meta features (e.g. cxx_std_17) that propagate to targets that link to Abseil" ON) option(ABSL_USE_SYSTEM_INCLUDES "Silence warnings in Abseil headers by marking them as SYSTEM includes" OFF) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/CMake ${CMAKE_CURRENT_LIST_DIR}/absl/copts ) option(ABSL_MSVC_STATIC_RUNTIME "Link static runtime libraries" OFF) if(ABSL_MSVC_STATIC_RUNTIME) set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") else() set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL") endif() include(CMakePackageConfigHelpers) include(GNUInstallDirs) include(AbseilDll) include(AbseilHelpers) ## ## Using absl targets ## ## all public absl targets are ## exported with the absl:: prefix ## ## e.g absl::base absl::synchronization absl::strings .... ## ## DO NOT rely on the internal targets outside of the prefix # include current path list(APPEND ABSL_COMMON_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}) if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") set(ABSL_USING_CLANG ON) else() set(ABSL_USING_CLANG OFF) endif() # find dependencies ## pthread find_package(Threads REQUIRED) include(CMakeDependentOption) option(ABSL_BUILD_TESTING "If ON, Abseil will build all of Abseil's own tests." OFF) option(ABSL_BUILD_TEST_HELPERS "If ON, Abseil will build libraries that you can use to write tests against Abseil code. This option requires that Abseil is configured to use GoogleTest." OFF) option(ABSL_USE_EXTERNAL_GOOGLETEST "If ON, Abseil will assume that the targets for GoogleTest are already provided by the including project. This makes sense when Abseil is used with add_subdirectory." OFF) cmake_dependent_option(ABSL_FIND_GOOGLETEST "If ON, Abseil will use find_package(GTest) rather than assuming that GoogleTest is already provided by the including project." ON "ABSL_USE_EXTERNAL_GOOGLETEST" OFF) option(ABSL_USE_GOOGLETEST_HEAD "If ON, abseil will download HEAD from GoogleTest at config time." OFF) set(ABSL_GOOGLETEST_DOWNLOAD_URL "" CACHE STRING "If set, download GoogleTest from this URL") set(ABSL_LOCAL_GOOGLETEST_DIR "/usr/src/googletest" CACHE PATH "If ABSL_USE_GOOGLETEST_HEAD is OFF and ABSL_GOOGLETEST_URL is not set, specifies the directory of a local GoogleTest checkout." ) option(ABSL_BUILD_MONOLITHIC_SHARED_LIBS "Build Abseil as a single shared library (always enabled for Windows)" OFF ) if(NOT BUILD_SHARED_LIBS AND ABSL_BUILD_MONOLITHIC_SHARED_LIBS) message(WARNING "Not building a shared library because BUILD_SHARED_LIBS is not set. Ignoring ABSL_BUILD_MONOLITHIC_SHARED_LIBS.") endif() if((BUILD_TESTING AND ABSL_BUILD_TESTING) OR ABSL_BUILD_TEST_HELPERS) if (ABSL_USE_EXTERNAL_GOOGLETEST) if (ABSL_FIND_GOOGLETEST) find_package(GTest REQUIRED) elseif(NOT TARGET GTest::gtest) if(TARGET gtest) # When Google Test is included directly rather than through find_package, the aliases are missing. add_library(GTest::gtest ALIAS gtest) add_library(GTest::gtest_main ALIAS gtest_main) add_library(GTest::gmock ALIAS gmock) add_library(GTest::gmock_main ALIAS gmock_main) else() message(FATAL_ERROR "ABSL_USE_EXTERNAL_GOOGLETEST is ON and ABSL_FIND_GOOGLETEST is OFF, which means that the top-level project must build the Google Test project. However, the target gtest was not found.") endif() endif() else() set(absl_gtest_build_dir ${CMAKE_BINARY_DIR}/googletest-build) if(ABSL_USE_GOOGLETEST_HEAD AND ABSL_GOOGLETEST_DOWNLOAD_URL) message(FATAL_ERROR "Do not set both ABSL_USE_GOOGLETEST_HEAD and ABSL_GOOGLETEST_DOWNLOAD_URL") endif() if(ABSL_USE_GOOGLETEST_HEAD) set(absl_gtest_download_url "https://github.com/google/googletest/archive/main.zip") elseif(ABSL_GOOGLETEST_DOWNLOAD_URL) set(absl_gtest_download_url ${ABSL_GOOGLETEST_DOWNLOAD_URL}) endif() if(absl_gtest_download_url) set(absl_gtest_src_dir ${CMAKE_BINARY_DIR}/googletest-src) else() set(absl_gtest_src_dir ${ABSL_LOCAL_GOOGLETEST_DIR}) endif() include(CMake/Googletest/DownloadGTest.cmake) endif() endif() add_subdirectory(absl) if(ABSL_ENABLE_INSTALL) # absl:lts-remove-begin(system installation is supported for LTS releases) # We don't support system-wide installation list(APPEND SYSTEM_INSTALL_DIRS "/usr/local" "/usr" "/opt/" "/opt/local" "c:/Program Files/${PROJECT_NAME}") if(NOT DEFINED CMAKE_INSTALL_PREFIX OR CMAKE_INSTALL_PREFIX IN_LIST SYSTEM_INSTALL_DIRS) message(WARNING "\ The default and system-level install directories are unsupported except in LTS \ releases of Abseil. Please set CMAKE_INSTALL_PREFIX to install Abseil in your \ source or build tree directly.\ ") endif() # absl:lts-remove-end # install as a subdirectory only install(EXPORT ${PROJECT_NAME}Targets NAMESPACE absl:: DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" ) configure_package_config_file( CMake/abslConfig.cmake.in "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" ) install(FILES "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" ) # Abseil only has a version in LTS releases. This mechanism is accomplished # Abseil's internal Copybara (https://github.com/google/copybara) workflows and # isn't visible in the CMake buildsystem itself. if(absl_VERSION) write_basic_package_version_file( "${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" COMPATIBILITY ExactVersion ) install(FILES "${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" ) endif() # absl_VERSION # Install the headers except for "options.h" which is installed separately. install(DIRECTORY absl DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} FILES_MATCHING PATTERN "*.inc" PATTERN "*.h" PATTERN "options.h" EXCLUDE PATTERN "copts" EXCLUDE PATTERN "testdata" EXCLUDE ) # Rewrite options.h to use the compiled ABI. file(READ "absl/base/options.h" ABSL_INTERNAL_OPTIONS_H_CONTENTS) # Handle features that require at least C++20. if (ABSL_INTERNAL_AT_LEAST_CXX20) foreach(FEATURE "ORDERING") string(REPLACE "#define ABSL_OPTION_USE_STD_${FEATURE} 2" "#define ABSL_OPTION_USE_STD_${FEATURE} 1" ABSL_INTERNAL_OPTIONS_H_PINNED "${ABSL_INTERNAL_OPTIONS_H_CONTENTS}") set(ABSL_INTERNAL_OPTIONS_H_CONTENTS "${ABSL_INTERNAL_OPTIONS_H_PINNED}") endforeach() endif() # Handle features that require at least C++17. if (ABSL_INTERNAL_AT_LEAST_CXX17) foreach(FEATURE "ANY" "OPTIONAL" "STRING_VIEW" "VARIANT") string(REPLACE "#define ABSL_OPTION_USE_STD_${FEATURE} 2" "#define ABSL_OPTION_USE_STD_${FEATURE} 1" ABSL_INTERNAL_OPTIONS_H_PINNED "${ABSL_INTERNAL_OPTIONS_H_CONTENTS}") set(ABSL_INTERNAL_OPTIONS_H_CONTENTS "${ABSL_INTERNAL_OPTIONS_H_PINNED}") endforeach() endif() # Any feature that still has the value of 2 (because it was not handled above) # should be set to 0. string(REGEX REPLACE "#define ABSL_OPTION_USE_STD_([^ ]*) 2" "#define ABSL_OPTION_USE_STD_\\1 0" ABSL_INTERNAL_OPTIONS_H_PINNED "${ABSL_INTERNAL_OPTIONS_H_CONTENTS}") # If the file already exists, check if it matches the new contents. # This avoids writing the file if it is already up-to-date when the CMake # generation is triggered and triggering unnecessary rebuilds. set(ABSL_INTERNAL_OPTIONS_H_PINNED_NEEDS_UPDATE TRUE) if (EXISTS "${CMAKE_BINARY_DIR}/options-pinned.h") file(READ "${CMAKE_BINARY_DIR}/options-pinned.h" ABSL_INTERNAL_OPTIONS_PINNED_H_CONTENTS) if ("${ABSL_INTERNAL_OPTIONS_H_PINNED}" STREQUAL "${ABSL_INTERNAL_OPTIONS_PINNED_H_CONTENTS}") set(ABSL_INTERNAL_OPTIONS_H_PINNED_NEEDS_UPDATE FALSE) endif() endif() # If the file needs an update, generate it. if (ABSL_INTERNAL_OPTIONS_H_PINNED_NEEDS_UPDATE) file(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/options-pinned.h" CONTENT "${ABSL_INTERNAL_OPTIONS_H_PINNED}") endif() install(FILES "${CMAKE_BINARY_DIR}/options-pinned.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/absl/base RENAME "options.h") endif() # ABSL_ENABLE_INSTALL 怎么修改
07-05
Language support for Java ™ for Visual Studio Code Visual Studio Marketplace Installs Join the chat at https://gitter.im/redhat-developer/vscode-java Build Status License Provides Java ™ language support via Eclipse ™ JDT Language Server, which utilizes Eclipse ™ JDT, M2Eclipse and Buildship. Quick Start Install the Extension On the following platforms, the extension should activate without any setup : win32-x64, darwin-x64, darwin-arm64, linux-x64, linux-arm64. If on another platform, or using the "universal" version, you can set a Java Development Kit. It must be Java 21 or above. Optionally, download and install a Java Development Kit for your project (Java 1.8 or above is supported). See Project JDKs for more details Extension is activated when you first access a Java file Recognizes projects with Maven or Gradle build files in the directory hierarchy. Features screencast Supports code from Java 1.8 to Java 24 Maven pom.xml project support Gradle project support (with experimental Android project import support) Standalone Java files support As-you-type reporting of parsing and compilation errors Code completion Code/Source actions / Refactoring Javadoc hovers Organize imports triggered manually or on save when pasting code into a java file with Ctrl+Shift+v (Cmd+Shift+v on Mac). Type search Code outline Code folding Code navigation Code lens (references/implementations) Highlights Code formatting (on-type/selection/file) Code snippets Annotation processing support (automatic for Maven projects) Semantic selection Diagnostic tags Call Hierarchy Type Hierarchy To launch and debug your Java programs, it's recommended you install Java Debug Extension for Visual Studio Code. See the changelog for the latest release. You might also find useful information in the project Wiki. Setting the JDK Java Tooling JDK Now that Java extension will publish platform specific versions, it will embed a JRE for supported platforms such as win32-x64, linux-x64, linux-arm64, darwin-x64, darwin-arm64. The embedded JRE is used to launch the Language Server for Java. Users are only responsible for configuring Project JDKs to compile your Java projects. The following part is only kept for the universal version without embedded JRE. The tooling JDK will be used to launch the Language Server for Java. And by default, will also be used to compile your projects. Java 21 is the minimum required version. The path to the Java Development Kit can be specified by the java.jdt.ls.java.home setting in VS Code settings (workspace/user settings). If not specified, it is searched in the following order until a JDK meets current minimum requirement. the JDK_HOME environment variable the JAVA_HOME environment variable on the current system path Project JDKs If you need to compile your projects against a different JDK version, it's recommended you configure the java.configuration.runtimes property in your user settings, eg: "java.configuration.runtimes": [ { "name": "JavaSE-1.8", "path": "/path/to/jdk-8", }, { "name": "JavaSE-11", "path": "/path/to/jdk-11", }, { "name": "JavaSE-24", "path": "/path/to/jdk-24", "default": true }, ] The default runtime will be used when you open standalone Java files. Available commands The following commands are available: Switch to Standard Mode: switches the Java Language Server to Standard mode. This command is only available when the Java Language Server is in LightWeight mode. Java: Reload Projects (Shift+Alt+U): It forces project configuration / classpath updates (eg. dependency changes or Java compilation level), according to the project build descriptor. Java: Import Java Projects into Workspace: detects and imports all the Java projects into the Java Language Server workspace. Java: Open Java Language Server Log File: opens the Java Language Server log file, useful for troubleshooting problems. Java: Open Java Extension Log File: opens the Java extension log file, useful for troubleshooting problems. Java: Open All Log Files: opens both the Java Language Server log file and the Java extension log file. Java: Force Java Compilation (Shift+Alt+B): manually triggers compilation of the workspace. Java: Rebuild Projects: manually triggers a full build of the selected projects. Java: Open Java Formatter Settings: opens the Eclipse formatter settings. Creates a new settings file if none exists. Java: Clean Java Language Server Workspace: cleans the Java language server workspace. Java: Attach Source: attaches a jar/zip source to the currently opened binary class file. This command is only available in the editor context menu. Java: Add Folder to Java Source Path: adds the selected folder to its project source path. This command is only available in the file explorer context menu and only works for unmanaged folders. Java: Remove Folder from Java Source Path: removes the selected folder from its project source path. This command is only available in the file explorer context menu and only works for unmanaged folders. Java: List All Java Source Paths: lists all the Java source paths recognized by the Java Language Server workspace. Java: Show Build Job Status: shows the Java Language Server job status in Visual Studio Code terminal. Java: Go to Super Implementation: goes to the super implementation for the current selected symbol in editor. Java: Restart Java Language Server: restarts the Java language server. Supported VS Code settings The following settings are supported: java.home : Deprecated, please use 'java.jdt.ls.java.home' instead. Absolute path to JDK home folder used to launch the Java Language Server. Requires VS Code restart. java.jdt.ls.lombokSupport.enabled: Whether to enable lombok support. Defaults to true. java.jdt.ls.vmargs : Extra VM arguments used to launch the Java Language Server. Requires VS Code restart. java.errors.incompleteClasspath.severity : Specifies the severity of the message when the classpath is incomplete for a Java file. Supported values are ignore, info, warning, error. java.trace.server : Traces the communication between VS Code and the Java language server. java.configuration.updateBuildConfiguration : Specifies how modifications on build files update the Java classpath/configuration. Supported values are disabled (nothing happens), interactive (asks about updating on every modification), automatic (updating is automatically triggered). java.configuration.maven.userSettings : Path to Maven's user settings.xml. java.configuration.checkProjectSettingsExclusions: Deprecated, please use 'java.import.generatesMetadataFilesAtProjectRoot' to control whether to generate the project metadata files at the project root. And use 'files.exclude' to control whether to hide the project metadata files from the file explorer. Controls whether to exclude extension-generated project settings files (.project, .classpath, .factorypath, .settings/) from the file explorer. Defaults to false. java.referencesCodeLens.enabled : Enable/disable the references code lenses. java.implementationCodeLens : Enable/disable the implementations code lens for the provided categories. java.signatureHelp.enabled : Enable/disable signature help support (triggered on (). java.signatureHelp.description.enabled : Enable/disable to show the description in signature help. Defaults to false. java.contentProvider.preferred : Preferred content provider (see 3rd party decompilers available in vscode-java-decompiler). java.import.exclusions : Exclude folders from import via glob patterns. Use ! to negate patterns to allow subfolders imports. You have to include a parent directory. The order is important. java.import.gradle.enabled : Enable/disable the Gradle importer. Specify the Gradle distribution used by the Java extension: java.import.gradle.wrapper.enabled: Use Gradle from the 'gradle-wrapper.properties' file. Defaults to true. java.import.gradle.version: Use Gradle from the specific version if the Gradle wrapper is missing or disabled. java.import.gradle.home: Use Gradle from the specified local installation directory or GRADLE_HOME if the Gradle wrapper is missing or disabled and no 'java.import.gradle.version' is specified. java.import.gradle.arguments: Arguments to pass to Gradle. java.import.gradle.jvmArguments: JVM arguments to pass to Gradle. java.import.gradle.user.home: setting for GRADLE_USER_HOME. java.import.gradle.offline.enabled: Enable/disable the Gradle offline mode. Defaults to false. java.import.maven.enabled : Enable/disable the Maven importer. java.autobuild.enabled : Enable/disable the 'auto build'. java.maxConcurrentBuilds: Set max simultaneous project builds. java.completion.enabled : Enable/disable code completion support. java.completion.guessMethodArguments : Specify how the arguments will be filled during completion. Defaults to auto. auto: Use off only when using Visual Studio Code - Insiders, other platform will defaults to insertBestGuessedArguments. off: Method arguments will not be inserted during completion. insertParameterNames: The parameter names will be inserted during completion. insertBestGuessedArguments: The best guessed arguments will be inserted during completion according to the code context. java.completion.filteredTypes: Defines the type filters. All types whose fully qualified name matches the selected filter strings will be ignored in content assist or quick fix proposals and when organizing imports. For example 'java.awt.*' will hide all types from the awt packages. java.completion.favoriteStaticMembers : Defines a list of static members or types with static members. java.completion.importOrder : Defines the sorting order of import statements. java.format.enabled : Enable/disable the default Java formatter. java.format.settings.url : Specifies the url or file path to the Eclipse formatter xml settings. java.format.settings.profile : Optional formatter profile name from the Eclipse formatter settings. java.format.comments.enabled : Includes the comments during code formatting. java.format.onType.enabled : Enable/disable on-type formatting (triggered on ;, } or <return>). java.foldingRange.enabled: Enable/disable smart folding range support. If disabled, it will use the default indentation-based folding range provided by VS Code. java.maven.downloadSources: Enable/disable download of Maven source artifacts as part of importing Maven projects. java.maven.updateSnapshots: Force update of Snapshots/Releases. Defaults to false. java.codeGeneration.hashCodeEquals.useInstanceof: Use 'instanceof' to compare types when generating the hashCode and equals methods. Defaults to false. java.codeGeneration.hashCodeEquals.useJava7Objects: Use Objects.hash and Objects.equals when generating the hashCode and equals methods. This setting only applies to Java 7 and higher. Defaults to false. java.codeGeneration.useBlocks: Use blocks in 'if' statements when generating the methods. Defaults to false. java.codeGeneration.generateComments: Generate method comments when generating the methods. Defaults to false. java.codeGeneration.toString.template: The template for generating the toString method. Defaults to ${object.className} [${member.name()}=${member.value}, ${otherMembers}]. java.codeGeneration.toString.codeStyle: The code style for generating the toString method. Defaults to STRING_CONCATENATION. java.codeGeneration.toString.skipNullValues: Skip null values when generating the toString method. Defaults to false. java.codeGeneration.toString.listArrayContents: List contents of arrays instead of using native toString(). Defaults to true. java.codeGeneration.toString.limitElements: Limit number of items in arrays/collections/maps to list, if 0 then list all. Defaults to 0. java.selectionRange.enabled: Enable/disable Smart Selection support for Java. Disabling this option will not affect the VS Code built-in word-based and bracket-based smart selection. java.showBuildStatusOnStart.enabled: Automatically show build status on startup, defaults to notification. notification: Show the build status via progress notification. terminal: Show the build status via terminal. off: Do not show any build status. For backward compatibility, this setting also accepts boolean value, where true has the same meaning as notification and false has the same meaning as off. java.project.outputPath: A relative path to the workspace where stores the compiled output. Only effective in the WORKSPACE scope. The setting will NOT affect Maven or Gradle project. java.project.referencedLibraries: Configure glob patterns for referencing local libraries to a Java project. java.completion.maxResults: Maximum number of completion results (not including snippets). 0 (the default value) disables the limit, all results are returned. In case of performance problems, consider setting a sensible limit. java.configuration.runtimes: Map Java Execution Environments to local JDKs. java.server.launchMode: Standard: Provides full features such as intellisense, refactoring, building, Maven/Gradle support etc. LightWeight: Starts a syntax server with lower start-up cost. Only provides syntax features such as outline, navigation, javadoc, syntax errors. The lightweight mode won't load thirdparty extensions, such as java test runner, java debugger, etc. Hybrid: Provides full features with better responsiveness. It starts a standard language server and a secondary syntax server. The syntax server provides syntax features until the standard server is ready. And the syntax server will be shutdown automatically after the standard server is fully ready. Default launch mode is Hybrid. Legacy mode is Standard java.sources.organizeImports.starThreshold: Specifies the number of imports added before a star-import declaration is used, default is 99. java.sources.organizeImports.staticStarThreshold: Specifies the number of static imports added before a star-import declaration is used, default is 99. java.imports.gradle.wrapper.checksums: Defines allowed/disallowed SHA-256 checksums of Gradle Wrappers. java.project.importOnFirstTimeStartup: Specifies whether to import the Java projects, when opening the folder in Hybrid mode for the first time. Supported values are disabled (never imports), interactive (asks to import or not), automatic (always imports). Default to automatic. java.project.importHint: Enable/disable the server-mode switch information, when Java projects import is skipped on startup. Defaults to true. java.import.gradle.java.home: Specifies the location to the JVM used to run the Gradle daemon. java.project.resourceFilters: Excludes files and folders from being refreshed by the Java Language Server, which can improve the overall performance. For example, ["node_modules",".git"] will exclude all files and folders named 'node_modules' or '.git'. Pattern expressions must be compatible with java.util.regex.Pattern. Defaults to ["node_modules",".git"]. java.templates.fileHeader: Specifies the file header comment for new Java file. Supports configuring multi-line comments with an array of strings, and using ${variable} to reference the predefined variables. java.templates.typeComment: Specifies the type comment for new Java type. Supports configuring multi-line comments with an array of strings, and using ${variable} to reference the predefined variables. java.references.includeAccessors: Include getter, setter and builder/constructor when finding references. Default to true. java.configuration.maven.globalSettings : Path to Maven's global settings.xml. java.configuration.maven.lifecycleMappings : Path to Maven's lifecycle mappings xml. java.eclipse.downloadSources : Enable/disable download of Maven source artifacts for Eclipse projects. java.references.includeDecompiledSources : Include the decompiled sources when finding references. Default to true. java.project.sourcePaths: Relative paths to the workspace where stores the source files. Only effective in the WORKSPACE scope. The setting will NOT affect Maven or Gradle project. java.typeHierarchy.lazyLoad: Enable/disable lazy loading the content in type hierarchy. Lazy loading could save a lot of loading time but every type should be expanded manually to load its content. java.codeGeneration.insertionLocation: Specifies the insertion location of the code generated by source actions. Defaults to afterCursor. afterCursor: Insert the generated code after the member where the cursor is located. beforeCursor: Insert the generated code before the member where the cursor is located. lastMember: Insert the generated code as the last member of the target type. java.codeGeneration.addFinalForNewDeclaration: Whether to generate the 'final' modifer for code actions that create new declarations. Defaults to none. none: Do not generate final modifier fields: Generate 'final' modifier only for new field declarations variables: Generate 'final' modifier only for new variable declarations all: Generate 'final' modifier for all new declarations java.settings.url : Specifies the url or file path to the workspace Java settings. See Setting Global Preferences java.symbols.includeSourceMethodDeclarations : Include method declarations from source files in symbol search. Defaults to false. java.quickfix.showAt : Show quickfixes at the problem or line level. java.configuration.workspaceCacheLimit : The number of days (if enabled) to keep unused workspace cache data. Beyond this limit, cached workspace data may be removed. java.import.generatesMetadataFilesAtProjectRoot : Specify whether the project metadata files(.project, .classpath, .factorypath, .settings/) will be generated at the project root. Defaults to false. java.inlayHints.parameterNames.enabled: Enable/disable inlay hints for parameter names. Supported values are: none(disable parameter name hints), literals(Enable parameter name hints only for literal arguments) and all(Enable parameter name hints for literal and non-literal arguments). Defaults to literals. java.compile.nullAnalysis.nonnull: Specify the Nonnull annotation types to be used for null analysis. If more than one annotation is specified, then the topmost annotation will be used first if it exists in your project dependencies. This setting will be ignored if java.compile.nullAnalysis.mode is set to disabled. java.compile.nullAnalysis.nullable: Specify the Nullable annotation types to be used for null analysis. If more than one annotation is specified, then the topmost annotation will be used first if it exists in your project dependencies. This setting will be ignored if java.compile.nullAnalysis.mode is set to disabled. java.compile.nullAnalysis.nonnullbydefault: Specify the NonNullByDefault annotation types to be used for null analysis. If more than one annotation is specified, then the topmost annotation will be used first if it exists in your project dependencies. This setting will be ignored if java.compile.nullAnalysis.mode is set to disabled. java.import.maven.offline.enabled: Enable/disable the Maven offline mode. Defaults to false. java.codeAction.sortMembers.avoidVolatileChanges: Reordering of fields, enum constants, and initializers can result in semantic and runtime changes due to different initialization and persistence order. This setting prevents this from occurring. Defaults to true. java.jdt.ls.protobufSupport.enabled: Specify whether to automatically add Protobuf output source directories to the classpath. Note: Only works for Gradle com.google.protobuf plugin 0.8.4 or higher. Defaults to true. java.jdt.ls.androidSupport.enabled: [Experimental] Specify whether to enable Android project importing. When set to auto, the Android support will be enabled in Visual Studio Code - Insiders. Note: Only works for Android Gradle Plugin 3.2.0 or higher. Defaults to auto. java.completion.postfix.enabled: Enable/disable postfix completion support. Defaults to true. java.completion.chain.enabled: Enable/disable chain completion support. Defaults to false. java.completion.matchCase: Specify whether to match case for code completion. Defaults to firstLetter. java.compile.nullAnalysis.mode: Specify how to enable the annotation-based null analysis. Supported values are disabled (disable the null analysis), interactive (asks when null annotation types are detected), automatic (automatically enable null analysis when null annotation types are detected). Defaults to interactive. java.cleanup.actionsOnSave: Deprecated, please use 'java.cleanup.actions' instead. The list of clean ups to be run on the current document when it's saved. Clean ups can automatically fix code style or programming mistakes. Click here to learn more about what each clean up does. java.cleanup.actions: The list of clean ups to be run on the current document when it's saved or when the cleanup command is issued. Clean ups can automatically fix code style or programming mistakes. Click here to learn more about what each clean up does. java.saveActions.cleanup: Enable/disable cleanup actions on save. java.import.gradle.annotationProcessing.enabled: Enable/disable the annotation processing on Gradle projects and delegate to JDT APT. Only works for Gradle 5.2 or higher. java.sharedIndexes.enabled: [Experimental] Specify whether to share indexes between different workspaces. Defaults to auto and the shared indexes is automatically enabled in Visual Studio Code - Insiders. auto on off java.sharedIndexes.location: Specifies a common index location for all workspaces. See default values as follows: Windows: First use "$APPDATA\\.jdt\\index", or "~\\.jdt\\index" if it does not exist macOS: "~/Library/Caches/.jdt/index" Linux: First use "$XDG_CACHE_HOME/.jdt/index", or "~/.cache/.jdt/index" if it does not exist java.refactoring.extract.interface.replace: Specify whether to replace all the occurrences of the subtype with the new extracted interface. Defaults to true. java.import.maven.disableTestClasspathFlag : Enable/disable test classpath segregation. When enabled, this permits the usage of test resources within a Maven project as dependencies within the compile scope of other projects. Defaults to false. java.configuration.maven.defaultMojoExecutionAction : Specifies default mojo execution action when no associated metadata can be detected. Defaults to ignore. java.completion.lazyResolveTextEdit.enabled: [Experimental] Enable/disable lazily resolving text edits for code completion. Defaults to true. java.edit.validateAllOpenBuffersOnChanges: Specifies whether to recheck all open Java files for diagnostics when editing a Java file. Defaults to false. java.editor.reloadChangedSources: Specifies whether to reload the sources of the open class files when their source jar files are changed. Defaults to ask. ask: Ask to reload the sources of the open class files auto: Automatically reload the sources of the open class files manual: Manually reload the sources of the open class files java.edit.smartSemicolonDetection.enabled: Defines the smart semicolon detection. Defaults to false. java.configuration.detectJdksAtStart: Automatically detect JDKs installed on local machine at startup. If you have specified the same JDK version in java.configuration.runtimes, the extension will use that version first. Defaults to true. java.completion.collapseCompletionItems: Enable/disable the collapse of overloaded methods in completion items. Overrides java.completion.guessMethodArguments. Defaults to false. java.diagnostic.filter: Specifies a list of file patterns for which matching documents should not have their diagnostics reported (eg. '**/Foo.java'). java.search.scope: Specifies the scope which must be used for search operation like Find Reference Call Hierarchy Workspace Symbols java.jdt.ls.javac.enabled: [Experimental] Specify whether to enable Javac-based compilation in the language server. Requires running this extension with Java 24. Defaults to off. java.completion.engine: [Experimental] Select code completion engine. Defaults to ecj. java.references.includeDeclarations: Include declarations when finding references. Defaults to true java.jdt.ls.appcds.enabled : [Experimental] Enable Java AppCDS (Application Class Data Sharing) for improvements to extension activation. When set to auto, AppCDS will be enabled in Visual Studio Code - Insiders, and for pre-release versions. Semantic Highlighting Semantic Highlighting fixes numerous syntax highlighting issues with the default Java Textmate grammar. However, you might experience a few minor issues, particularly a delay when it kicks in, as it needs to be computed by the Java Language server, when opening a new file or when typing. Semantic highlighting can be disabled for all languages using the editor.semanticHighlighting.enabled setting, or for Java only using language-specific editor settings. Troubleshooting Check the status of the language tools on the lower right corner (marked with A on image below). It should show ready (thumbs up) as on the image below. You can click on the status and open the language tool logs for further information in case of a failure. status indicator Read the troubleshooting guide for collecting informations about issues you might encounter. Report any problems you face to the project. Contributing This is an open source project open to anyone. Contributions are extremely welcome! For information on getting started, refer to the CONTRIBUTING instructions. Continuous Integration builds can be installed from http://download.jboss.org/jbosstools/jdt.ls/staging/. Download the most recent java-<version>.vsix file and install it by following the instructions here. Stable releases are archived under http://download.jboss.org/jbosstools/static/jdt.ls/stable/. Also, you can contribute your own VS Code extension to enhance the existing features by following the instructions here. Feedback Have a question? Start a discussion on GitHub Discussions, File a bug in GitHub Issues, Chat with us on Gitter, Tweet us with other feedback. License EPL 2.0, See LICENSE for more information.
最新发布
09-21
#!/bin/sh #![allow(missing_abi)] /* # rust shebang by Mahmoud Al-Qudsi, Copyright NeoSmart Technologies 2020-2024 # See <https://neosmart.net/blog/self-compiling-rust-code/> for info & updates. # # This code is freely released to the public domain. In case a public domain # license is insufficient for your legal department, this code is also licensed # under the MIT license. # Get an output path that is derived from the complete path to this self script. # - `realpath` makes sure if you have two separate `script.rs` files in two # different directories, they get mapped to different binaries. # - `which` makes that work even if you store this script in $PATH and execute # it by its filename alone. # - `cut` is used to print only the hash and not the filename, which `md5sum` # always includes in its output. OUT=/tmp/$(printf "%s" $(realpath $(which "$0")) | md5sum | cut -d' ' -f1) # Calculate hash of the current contents of the script, so we can avoid # recompiling if it hasn't changed. MD5=$(md5sum "$0" | cut -d' ' -f1) # Check if we have a previously compiled output for this exact source code. if !(test -x "${OUT}" && test -f "${OUT}.md5" && \ test "${MD5}" = "$(cat "${OUT}.md5")"); then # The script has been modified or is otherwise not cached. # Check if the script already contains an `fn main()` entry point. if grep -Eq '^\s*(\[([^][]*)])*\s*fn\s+main\b' "$0"; then # Compile the input script as-is to the previously determined location. rustc "$0" -o ${OUT} # Save rustc's exit code so we can compare against it later. RUSTC_STATUS=$? else # The script does not contain an `fn main()` entry point, so add one. # We don't use `printf 'fn main() { %s }' because the shebang must # come at the beginning of the line, and we don't use `tail` to skip # it because that would result in incorrect line numbers in any errors # reported by rustc, instead we just comment out the shebang but leave # it on the same line as `fn main() {`. printf "fn main() {//%s\n}" "$(cat $0)" | rustc - -o ${OUT} # Save rustc's exit code so we can compare against it later. RUSTC_STATUS=$? fi # Check if we compiled the script OK, or exit bubbling up the return code. if test "${RUSTC_STATUS}" -ne 0; then exit ${RUSTC_STATUS} fi # Save the MD5 of the current version of the script so we can compare # against it next time. printf "%s" ${MD5} > ${OUT}.md5 fi # Execute the compiled output. This also ends execution of the shell script, # as it actually replaces its process with ours; see exec(3) for more on this. exec ${OUT} "$@" # At this point, it's OK to write raw rust code as the shell interpreter # never gets this far. But we're actually still in the rust comment we opened # on line 2, so close that: */ fn main() { let name = std::env::args().skip(1).next().unwrap_or("world".into()); println!("Hello, {}!", name); } // vim: ft=rust : 解释以下这段代码
04-02
<?xml version="1.0" encoding="utf-8"?> <!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. --> <Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <!-- Common targets for managed compilers. --> <UsingTask TaskName="Microsoft.CodeAnalysis.BuildTasks.MapSourceRoots" AssemblyFile="$(MSBuildThisFileDirectory)Microsoft.Build.Tasks.CodeAnalysis.dll" /> <Import Project="Microsoft.Managed.Core.CurrentVersions.targets" /> <Target Name="ShimReferencePathsWhenCommonTargetsDoesNotUnderstandReferenceAssemblies" BeforeTargets="CoreCompile" Condition="'@(ReferencePathWithRefAssemblies)' == ''"> <!-- FindReferenceAssembliesForReferences target in Common targets populate this item since dev15.3. The compiler targets may be used (via NuGet package) on earlier MSBuilds. If the ReferencePathWithRefAssemblies item is not populated, just use ReferencePaths (implementation assemblies) as they are. Since XAML inner build runs CoreCompile directly (instead of Compile target), it also doesn't invoke FindReferenceAssembliesForReferences listed in CompileDependsOn. In that case we also populate ReferencePathWithRefAssemblies with implementation assemblies. --> <ItemGroup> <ReferencePathWithRefAssemblies Include="@(ReferencePath)" /> </ItemGroup> </Target> <Target Name="_BeforeVBCSCoreCompile" DependsOnTargets="ShimReferencePathsWhenCommonTargetsDoesNotUnderstandReferenceAssemblies"> <ItemGroup Condition="'$(TargetingClr2Framework)' == 'true'"> <ReferencePathWithRefAssemblies> <EmbedInteropTypes /> </ReferencePathWithRefAssemblies> </ItemGroup> <!-- Prefer32Bit was introduced in .NET 4.5. Set it to false if we are targeting 4.0 --> <PropertyGroup Condition="('$(TargetFrameworkVersion)' == 'v4.0')"> <Prefer32Bit>false</Prefer32Bit> </PropertyGroup> <!-- TODO: Remove this ItemGroup once it has been moved to "_GenerateCompileInputs" target in Microsoft.Common.CurrentVersion.targets. https://github.com/dotnet/roslyn/issues/12223 --> <ItemGroup Condition="('$(AdditionalFileItemNames)' != '')"> <AdditionalFileItems Include="$(AdditionalFileItemNames)" /> <AdditionalFiles Include="@(%(AdditionalFileItems.Identity))" /> </ItemGroup> <PropertyGroup Condition="'$(UseSharedCompilation)' == ''"> <UseSharedCompilation>true</UseSharedCompilation> </PropertyGroup> </Target> <!-- ======================== SkipAnalyzers Support ======================== --> <UsingTask TaskName="Microsoft.CodeAnalysis.BuildTasks.ShowMessageForImplicitlySkipAnalyzers" AssemblyFile="$(MSBuildThisFileDirectory)Microsoft.Build.Tasks.CodeAnalysis.dll" /> <Target Name="_ComputeSkipAnalyzers" BeforeTargets="CoreCompile"> <!-- First, force clear non-user facing properties '_SkipAnalyzers' and '_ImplicitlySkipAnalyzers'. --> <PropertyGroup> <_SkipAnalyzers></_SkipAnalyzers> <_ImplicitlySkipAnalyzers></_ImplicitlySkipAnalyzers> </PropertyGroup> <!-- Then, determine if '_SkipAnalyzers' needs to be 'true' based on user facing property 'RunAnalyzers'. If 'RunAnalyzers' is not set, then fallback to user facing property 'RunAnalyzersDuringBuild'. Latter property allows users to disable analyzers only for non-design time builds. Design time builds are background builds inside Visual Studio, see details here: https://github.com/dotnet/project-system/blob/main/docs/design-time-builds.md. Setting 'RunAnalyzersDuringBuild' to false, without setting 'RunAnalyzers', allows users to continue running analyzers in the background in Visual Studio while typing (i.e. intellisense), while disabling analyzer execution on explicitly invoked non-design time builds. --> <PropertyGroup Condition="'$(RunAnalyzers)' == 'false' or ('$(RunAnalyzers)' == '' and '$(RunAnalyzersDuringBuild)' == 'false')"> <_SkipAnalyzers>true</_SkipAnalyzers> </PropertyGroup> <!-- PERF: For builds which are indirectly triggered inside Visual Studio from commands such as from 'Run Tests' or 'Start Debugging', we implicitly skip analyzers and nullable analysis to speed up the build. We only do so by default when 'TreatWarningsAsErrors' is not 'true'. For the scenario where 'TreatWarningsAsErrors' is 'true', users can explicitly enable this functionality by setting 'OptimizeImplicitlyTriggeredBuild' to 'true'. NOTE: This feature is currently supported only for SDK-style projects, i.e. UsingMicrosoftNETSdk = true. --> <PropertyGroup Condition="'$(_SkipAnalyzers)' == '' and '$(IsImplicitlyTriggeredBuild)' == 'true' and '$(UsingMicrosoftNETSdk)' == 'true' and '$(OptimizeImplicitlyTriggeredBuild)' != 'false' and ('$(TreatWarningsAsErrors)' != 'true' or '$(OptimizeImplicitlyTriggeredBuild)' == 'true')"> <_ImplicitlySkipAnalyzers>true</_ImplicitlySkipAnalyzers> <_SkipAnalyzers>true</_SkipAnalyzers> <Features>run-nullable-analysis=never;$(Features)</Features> </PropertyGroup> <!-- Display a message to inform the users about us implicitly skipping analyzers for speeding up indirect builds. --> <ShowMessageForImplicitlySkipAnalyzers Condition="'$(_ImplicitlySkipAnalyzers)' == 'true'"/> <!-- Semaphore file to indicate the time stamp for last build with skipAnalyzers flag. --> <PropertyGroup> <_LastBuildWithSkipAnalyzers>$(IntermediateOutputPath)$(MSBuildProjectFile).BuildWithSkipAnalyzers</_LastBuildWithSkipAnalyzers> </PropertyGroup> <!-- '_LastBuildWithSkipAnalyzers' semaphore file, if exists, is passed as custom additional file input to builds without skipAnalyzers flag to ensure correct incremental builds. Additionally, we need to pass this file as an 'UpToDateCheckInput' item with 'Kind = ImplicitBuild' for project system's fast-upto-date check to work correctly. See https://github.com/dotnet/project-system/issues/7290 for details. --> <ItemGroup Condition="Exists('$(_LastBuildWithSkipAnalyzers)') and '$(_SkipAnalyzers)' != 'true'"> <CustomAdditionalCompileInputs Include="$(_LastBuildWithSkipAnalyzers)"/> <UpToDateCheckInput Include="$(_LastBuildWithSkipAnalyzers)" Kind="ImplicitBuild"/> </ItemGroup> </Target> <!-- We touch and create a semaphore file after build to indicate the time stamp for last build with skipAnalyzers flag. --> <Target Name="_TouchLastBuildWithSkipAnalyzers" Condition="'$(_SkipAnalyzers)' == 'true'" AfterTargets="CoreCompile"> <Touch AlwaysCreate="true" Files="$(_LastBuildWithSkipAnalyzers)"/> </Target> <!-- ======================== .editorconfig Support ======================== --> <ItemGroup> <_AllDirectoriesAbove Include="@(Compile->GetPathsOfAllDirectoriesAbove())" Condition="'$(DiscoverEditorConfigFiles)' != 'false' or '$(DiscoverGlobalAnalyzerConfigFiles)' != 'false'" /> <!-- Work around a GetPathsOfAllDirectoriesAbove() bug where it can return multiple equivalent paths when the compilation includes linked files with relative paths - https://github.com/microsoft/msbuild/issues/4392 --> <PotentialEditorConfigFiles Include="@(_AllDirectoriesAbove->'%(FullPath)'->Distinct()->Combine('.editorconfig'))" Condition="'$(DiscoverEditorConfigFiles)' != 'false'" /> <EditorConfigFiles Include="@(PotentialEditorConfigFiles->Exists())" Condition="'$(DiscoverEditorConfigFiles)' != 'false'" /> <GlobalAnalyzerConfigFiles Include="@(_AllDirectoriesAbove->'%(FullPath)'->Distinct()->Combine('.globalconfig'))" Condition="'$(DiscoverGlobalAnalyzerConfigFiles)' != 'false'" /> <EditorConfigFiles Include="@(GlobalAnalyzerConfigFiles->Exists())" Condition="'$(DiscoverGlobalAnalyzerConfigFiles)' != 'false'" /> </ItemGroup> <!-- ======================== Property/metadata global .editorconfig Support ======================== Generates a global editor config that contains the evaluation of requested MSBuild properties and item metadata Requested properties/items are requested via item groups like: <CompilerVisibleProperty Include="PropertyNameToEval" /> <CompilerVisibleItemMetadata Include="ItemType" MetadataName="MetadataToRetrieve" /> --> <UsingTask TaskName="Microsoft.CodeAnalysis.BuildTasks.GenerateMSBuildEditorConfig" AssemblyFile="$(MSBuildThisFileDirectory)Microsoft.Build.Tasks.CodeAnalysis.dll" /> <Target Name="GenerateMSBuildEditorConfigFile" BeforeTargets="BeforeCompile;CoreCompile" DependsOnTargets="PrepareForBuild;GenerateMSBuildEditorConfigFileShouldRun;GenerateMSBuildEditorConfigFileCore" /> <Target Name="GenerateMSBuildEditorConfigFileShouldRun"> <PropertyGroup> <GeneratedMSBuildEditorConfigFile Condition="'$(GeneratedMSBuildEditorConfigFile)' == ''">$(IntermediateOutputPath)$(MSBuildProjectName).GeneratedMSBuildEditorConfig.editorconfig</GeneratedMSBuildEditorConfigFile> <GenerateMSBuildEditorConfigFile Condition="'$(GenerateMSBuildEditorConfigFile)' == ''">true</GenerateMSBuildEditorConfigFile> <_GeneratedEditorConfigHasItems Condition="'@(CompilerVisibleItemMetadata->Count())' != '0'">true</_GeneratedEditorConfigHasItems> <_GeneratedEditorConfigShouldRun Condition="'$(GenerateMSBuildEditorConfigFile)' == 'true' and ('$(_GeneratedEditorConfigHasItems)' == 'true' or '@(CompilerVisibleProperty->Count())' != '0')">true</_GeneratedEditorConfigShouldRun> </PropertyGroup> </Target> <Target Name="GenerateMSBuildEditorConfigFileCore" Condition="'$(_GeneratedEditorConfigShouldRun)' == 'true'" Outputs="$(GeneratedMSBuildEditorConfigFile)"> <ItemGroup> <!-- Collect requested properties, and eval their value --> <_GeneratedEditorConfigProperty Include="@(CompilerVisibleProperty)"> <Value>$(%(CompilerVisibleProperty.Identity))</Value> </_GeneratedEditorConfigProperty> <!-- Collect the requested items and remember which metadata is wanted --> <_GeneratedEditorConfigMetadata Include="@(%(CompilerVisibleItemMetadata.Identity))" Condition="'$(_GeneratedEditorConfigHasItems)' == 'true'"> <ItemType>%(Identity)</ItemType> <MetadataName>%(CompilerVisibleItemMetadata.MetadataName)</MetadataName> </_GeneratedEditorConfigMetadata> <!-- Record that we'll write a file, and add it to the analyzerconfig inputs --> <FileWrites Include="$(GeneratedMSBuildEditorConfigFile)" /> <EditorConfigFiles Include="$(GeneratedMSBuildEditorConfigFile)" /> </ItemGroup> <!-- Transform the collected properties and items into an editor config file --> <GenerateMSBuildEditorConfig PropertyItems="@(_GeneratedEditorConfigProperty)" MetadataItems="@(_GeneratedEditorConfigMetadata)" FileName="$(GeneratedMSBuildEditorConfigFile)"> </GenerateMSBuildEditorConfig> </Target> <!-- ======================== DeterministicSourcePaths ======================== Unless specified otherwise enable deterministic source root (PathMap) when building deterministically on CI server, but not for local builds. In order for the debugger to find source files when debugging a locally built binary the PDB must contain original, unmapped local paths. --> <PropertyGroup> <DeterministicSourcePaths Condition="'$(DeterministicSourcePaths)' == '' and '$(Deterministic)' == 'true' and '$(ContinuousIntegrationBuild)' == 'true'">true</DeterministicSourcePaths> </PropertyGroup> <!-- ========== SourceRoot ========== All source files of the project are expected to be located under one of the directories specified by SourceRoot item group. This target collects all SourceRoots from various sources. This target calculates final local path for each SourceRoot and sets SourceRoot.MappedPath metadata accordingly. The final path is a path with deterministic prefix when DeterministicSourcePaths is true, and the original path otherwise. In addition, the target validates and deduplicates the SourceRoot items. InitializeSourceControlInformation is an msbuild target that ensures the SourceRoot items are populated from source control. The target is available only if SourceControlInformationFeatureSupported is true. A consumer of SourceRoot.MappedPath metadata, such as Source Link generator, shall depend on this target. --> <Target Name="InitializeSourceRootMappedPaths" DependsOnTargets="_InitializeSourceRootMappedPathsFromSourceControl" Returns="@(SourceRoot)"> <ItemGroup Condition="'@(_MappedSourceRoot)' != ''"> <_MappedSourceRoot Remove="@(_MappedSourceRoot)" /> </ItemGroup> <Microsoft.CodeAnalysis.BuildTasks.MapSourceRoots SourceRoots="@(SourceRoot)" Deterministic="$(DeterministicSourcePaths)"> <Output TaskParameter="MappedSourceRoots" ItemName="_MappedSourceRoot" /> </Microsoft.CodeAnalysis.BuildTasks.MapSourceRoots> <ItemGroup> <SourceRoot Remove="@(SourceRoot)" /> <SourceRoot Include="@(_MappedSourceRoot)" /> </ItemGroup> </Target> <!-- Declare that target InitializeSourceRootMappedPaths that populates MappedPaths metadata on SourceRoot items is available. --> <PropertyGroup> <SourceRootMappedPathsFeatureSupported>true</SourceRootMappedPathsFeatureSupported> </PropertyGroup> <!-- If InitializeSourceControlInformation target isn't supported, we just continue without invoking that synchronization target. We'll proceed with SourceRoot (and other source control properties) provided by the user (or blank). --> <Target Name="_InitializeSourceRootMappedPathsFromSourceControl" DependsOnTargets="InitializeSourceControlInformation" Condition="'$(SourceControlInformationFeatureSupported)' == 'true'" /> <!-- ======= PathMap ======= If DeterministicSourcePaths is true sets PathMap based on SourceRoot.MappedPaths. This target requires SourceRoot to be initialized in order to calculate the PathMap. If SourceRoot doesn't contain any top-level roots an error is reported. --> <Target Name="_SetPathMapFromSourceRoots" DependsOnTargets="InitializeSourceRootMappedPaths" BeforeTargets="CoreCompile" Condition="'$(DeterministicSourcePaths)' == 'true'"> <ItemGroup> <_TopLevelSourceRoot Include="@(SourceRoot)" Condition="'%(SourceRoot.NestedRoot)' == ''"> <EscapedKey>$([MSBuild]::ValueOrDefault('%(Identity)', '').Replace(',', ',,').Replace('=', '=='))</EscapedKey> <EscapedValue>$([MSBuild]::ValueOrDefault('%(MappedPath)', '').Replace(',', ',,').Replace('=', '=='))</EscapedValue> </_TopLevelSourceRoot> </ItemGroup> <PropertyGroup Condition="'@(_TopLevelSourceRoot)' != ''"> <!-- Prepend the SourceRoot.MappedPath values to PathMap, if it already has a value. For each emitted source path the compiler applies the first mapping that matches the path. PathMap values set previously will thus only be applied if the mapping provided by SourceRoot.MappedPath doesn't match. Since SourceRoot.MappedPath is also used by SourceLink preferring it over manually set PathMap ensures that PathMap is consistent with SourceLink. --> <PathMap>@(_TopLevelSourceRoot->'%(EscapedKey)=%(EscapedValue)', ','),$(PathMap)</PathMap> </PropertyGroup> </Target> <!-- ======= CopyAdditionalFiles ======= If a user requests that any @(AdditionalFiles) items are copied to the output directory we add them to the @(None) group to ensure they will be copied. --> <Target Name="CopyAdditionalFiles" BeforeTargets="AssignTargetPaths"> <ItemGroup> <None Include="@(AdditionalFiles)" Condition="'%(AdditionalFiles.CopyToOutputDirectory)' != ''" /> </ItemGroup> </Target> <!-- ======================== CompilerGeneratedFilesOutputPath ======================== Controls output of generated files. CompilerGeneratedFilesOutputPath controls the location the files will be output to. The compiler will not emit any generated files when the path is empty, and defaults to a /generated directory in $(IntermediateOutputPath) if $(IntermediateOutputPath) has a value. EmitCompilerGeneratedFiles allows the user to control if anything is emitted by clearing the property when not true. When EmitCompilerGeneratedFiles is true, we ensure that CompilerGeneatedFilesOutputPath has a value and issue a warning if not. We will create CompilerGeneratedFilesOutputPath if it does not exist. --> <PropertyGroup> <EmitCompilerGeneratedFiles Condition="'$(EmitCompilerGeneratedFiles)' == ''">false</EmitCompilerGeneratedFiles> <CompilerGeneratedFilesOutputPath Condition="'$(EmitCompilerGeneratedFiles)' != 'true'"></CompilerGeneratedFilesOutputPath> <CompilerGeneratedFilesOutputPath Condition="'$(EmitCompilerGeneratedFiles)' == 'true' and '$(CompilerGeneratedFilesOutputPath)' == '' and '$(IntermediateOutputPath)' != ''">$(IntermediateOutputPath)/generated</CompilerGeneratedFilesOutputPath> </PropertyGroup> <Target Name="CreateCompilerGeneratedFilesOutputPath" BeforeTargets="CoreCompile" Condition="'$(EmitCompilerGeneratedFiles)' == 'true' and !('$(DesignTimeBuild)' == 'true' OR '$(BuildingProject)' != 'true')"> <Warning Condition="'$(CompilerGeneratedFilesOutputPath)' == ''" Text="EmitCompilerGeneratedFiles was true, but no CompilerGeneratedFilesOutputPath was provided. CompilerGeneratedFilesOutputPath must be set in order to emit generated files." /> <MakeDir Condition="'$(CompilerGeneratedFilesOutputPath)' != ''" Directories="$(CompilerGeneratedFilesOutputPath)" /> </Target> <!-- ======================== Component Debugger Support ======================== Add the specified VS capability if a user indicates this project supports component debugging --> <ItemGroup> <ProjectCapability Include="RoslynComponent" Condition="'$(IsRoslynComponent)' == 'true'"/> </ItemGroup> </Project> 如何改这个代码让其不报要求“SourceRoot”路径以斜杠或反斜杠结尾:“D:\Nuget\.nuget\packages”
06-25
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值