I m trying to build Android s emulator: https://android.googlesource.com/platform/external/qemu.git/+/refs/heads/aosp-emu-30-release
I cloned the entire AOSP source and added some missing packages to the default.xml from repo, here they are:
<project name="platform/external/qemu" path="external/qemu" revision="791783c6e74c936a8fcd231ad36219385723bb8a" upstream="refs/heads/aosp-emu-30-release" dest-branch="refs/heads/aosp-emu-30-release" groups="pdk" clone-depth="1"/>
<project name="platform/prebuilts/android-emulator-build/qemu-android-deps" path="prebuilts/android-emulator-build/qemu-android-deps" revision="715d3bed0a3dc4f9980528c9bfb81469f2d3cbab" upstream="refs/heads/aosp-emu-30-release" dest-branch="refs/heads/aosp-emu-30-release" groups="pdk" clone-depth="1"/>
<project name="platform/prebuilts/android-emulator-build/common" path="prebuilts/android-emulator-build/common" revision="180c9a42b79f9c22a38f902564ea3950d4460a96" upstream="refs/heads/aosp-emu-30-release" dest-branch="refs/heads/aosp-emu-30-release" groups="pdk" clone-depth="1"/>
<project name="platform/prebuilts/android-emulator-build/qt" path="prebuilts/android-emulator-build/qt" revision="23cbd79e9db666af535e2cefcb23fcdf0ff0c123" upstream="refs/heads/aosp-emu-30-release" dest-branch="refs/heads/aosp-emu-30-release" groups="pdk" clone-depth="1"/>
<project name="platform/prebuilts/android-emulator-build/mesa" path="prebuilts/android-emulator-build/mesa" revision="be7c00f399b415511d73308f0af0c0310512aced" upstream="refs/heads/aosp-emu-30-release" dest-branch="refs/heads/aosp-emu-30-release" groups="pdk" clone-depth="1"/>
<project name="platform/prebuilts/android-emulator-build/mesa-deps" path="prebuilts/android-emulator-build/mesa-deps" revision="17837fdb1889014fa01cbbbda56afc9b6034815f" upstream="refs/heads/aosp-emu-30-release" dest-branch="refs/heads/aosp-emu-30-release" groups="pdk" clone-depth="1"/>
<project name="platform/prebuilts/android-emulator-build/curl" path="prebuilts/android-emulator-build/curl" revision="06f0905068b9ebfdd2d11b4d310c36b68c2fbe2f" upstream="refs/heads/aosp-emu-30-release" dest-branch="refs/heads/aosp-emu-30-release" groups="pdk" clone-depth="1"/>
<project name="platform/prebuilts/android-emulator-build/archive" path="prebuilts/android-emulator-build/archive" revision="0545d85d4442d77841f8a81ecd2627aff175ce02" upstream="refs/heads/aosp-emu-30-release" dest-branch="refs/heads/aosp-emu-30-release" groups="pdk" clone-depth="1"/>
<project name="platform/prebuilts/android-emulator-build/protobuf" path="prebuilts/android-emulator-build/protobuf" revision="8e2a5472dd374e6c971d30eb3d00898a8c1a25c8" upstream="refs/heads/aosp-emu-30-release" dest-branch="refs/heads/aosp-emu-30-release" groups="pdk" clone-depth="1"/>
<project name="platform/external/grpc-grpc" path="external/grpc" revision="0d80ea35ba09d0462ca13f236cc9ddc3fb749c57" upstream="refs/heads/aosp-emu-30-release" dest-branch="refs/heads/aosp-emu-30-release" groups="pdk" clone-depth="1"/>
I added all of them when I noticed they missing when trying to compile by running android/rebuild.sh on the platform/external/qemu repo. Until I arrived at this error:
CMake Error at android/android-grpc/CMakeLists.txt:2 (add_subdirectory):
add_subdirectory given source
"/home/project/disk/aosp/grapheneos-lz_experiments/external/qemu/../grpc/emulator"
which is not an existing directory.
There s no platform/external/grpc repo, but there is platform/external/grpc-grpc which as you see below, I made appear at the path external/grpc:
<project name="platform/external/grpc-grpc" path="external/grpc" revision="0d80ea35ba09d0462ca13f236cc9ddc3fb749c57" upstream="refs/heads/aosp-emu-30-release" dest-branch="refs/heads/aosp-emu-30-release" groups="pdk" clone-depth="1"/>
Would be nice to know why the repo isn t named just grpc instead of grpc-grpc or why the compiler does not try to load from grpc-grpc instead of grpc
Related
I am trying to setup a default location for OutDir and IntDir to be used by all projects in the solution. Such as: <OutDir>$(SolutionDir)bld\$(Platform)\$(ProjectName)\$(Configuration)\</OutDir>
When I set this in the Directory.Build.props file, it looks okay in Visual Studio Properties dialog; but when I build, the $(ProjectName) portion is empty. This tells me that this macro was not available when OutDir was read in Directory.Build.props.
I tried adding this to the Directory.Build.targets file and it appeared to be ignored altogether.
Another goal is to not modify any of the vcxproj files after this initial change. And new projects would inherit these settings automatically.
Is this possible? Perhaps I am placing the setting in the wrong place/order in the file... ?
This is a snippet of the Directory.Build.props:
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets">
</ImportGroup>
<!-- Define macros for easy and consistent access to various parts of the tree -->
<PropertyGroup Label="UserMacros">
<GslInclude>$(SolutionDir)packages\Microsoft.Gsl.0.1.2.1\build\native\include</GslInclude>
<mySrcDir>$(SolutionDir)src\</mySrcDir>
<myBldDir>$(SolutionDir)bld\</myBldDir>
<myBldIntDir>$(SolutionDir)bld_int\</myBldIntDir>
</PropertyGroup>
<ItemDefinitionGroup />
<ItemGroup>
<BuildMacro Include="GslInclude"> <Value>$(GslInclude)</Value> </BuildMacro>
<BuildMacro Include="mySrcDir"> <Value>$(mySrcDir)</Value> </BuildMacro>
<BuildMacro Include="myBldDir"> <Value>$(myBldDir)</Value> </BuildMacro>
<BuildMacro Include="myBldIntDir"> <Value>$(myBldIntDir)</Value> </BuildMacro>
</ItemGroup>
<!-- Platform Toolset, Windows SDK -->
<PropertyGroup Label="Globals">
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<!-- Default Compiler settings -->
<ItemDefinitionGroup>
<ClCompile>
<!-- .... -->
</ClCompile>
</ItemDefinitionGroup>
<!-- Default Folders for target output -->
<PropertyGroup>
<OutDir>$(myBldDir)$(Platform)\$(ProjectName)\$(Configuration)\</OutDir>
<IntDir>$(myBldIntDir)$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
</PropertyGroup>
</Project>
And then of course, I simply remove all <OutDir> and <IntDir> settings in the proj files.
I would also love to be able to place conditions on settings based on the version of Visual Studio. Some of our developers are using VS2017 with older ToolSet; some are using VS2019 with the latest....
Thanks to those who helped with this. I got it working - at least for my main goal of establishing a pre-defined location for build 'output'.
Referencing information from here: https://learn.microsoft.com/en-us/visualstudio/msbuild/customize-your-build?view=vs-2019 and searching around in the VS props files, I find a macro 'MSBuildProjectName' which is set early in the process.
I created a Directory.Build.props file in the root of my build tree with contents like this:
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets">
</ImportGroup>
<!-- Define macros for easy and consistent access to various parts of the tree -->
<PropertyGroup Label="UserMacros">
<GslInclude>$(SolutionDir)packages\Microsoft.Gsl.0.1.2.1\build\native\include</GslInclude>
<myBldDir>$(SolutionDir)bld\</myBldDir>
<myBldIntDir>$(SolutionDir)bld_int\</myBldIntDir>
</PropertyGroup>
<ItemDefinitionGroup />
<ItemGroup>
<BuildMacro Include="GslInclude"> <Value>$(GslInclude)</Value> </BuildMacro>
<BuildMacro Include="myBldDir"> <Value>$(myBldDir)</Value> </BuildMacro>
<BuildMacro Include="myBldIntDir"> <Value>$(myBldIntDir)</Value> </BuildMacro>
</BuildMacro>
<!-- etc .... -->
</ItemGroup>
<!-- Platform Toolset, Windows SDK -->
<PropertyGroup Label="Globals">
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup>
<IntDir>$(myBldIntDir)$(Platform)\$(MSBuildProjectName)\$(Configuration)\</IntDir>
<OutDir>$(myBldDir)$(Platform)\$(MSBuildProjectName)\$(Configuration)\</OutDir>
</PropertyGroup>
<!-- lots more .... -->
</Project>
Settings in this file affect all projects living 'below' it in the folder structure.
If a sub-folder needs a different value, add a Directory.Build.props to that folder which imports the 'parent' props file (it may be several layers above):
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
<ImportGroup Label="PropertySheets">
</ImportGroup>
<PropertyGroup>
<IntDir>$(myBldIntDir)$(Platform)\Tests\$(MSBuildProjectName)\$(Configuration)\</IntDir>
<OutDir>$(myBldDir)$(Platform)\Tests\$(MSBuildProjectName)\$(Configuration)\</OutDir>
</PropertyGroup>
</Project>
Settings in the 'child' props file override anything set in its parents.
Once I removed all <OutDir> and <IntDir> elements in the XML project files, the "Output Directory" and "Intermediate Directory" settings show up in regular font (not bold which indicates it is not inheriting) and, of course, when I build, everything goes to the consolidated folder tree; away from the source. And the cool thing: New projects will be populated automatically with these new default settings.
note: #dxiv points out that some settings may be pickier and require more work.
It is possible, and it is in fact the recommended way to share settings between projects. Only caveat is that the scheme is rather sensitive to the section tags and order/placement of inclusions. The following should work for OutDir and IntDir.
Directory.Build.props
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_PropertySheetDisplayName>Directory.Build</_PropertySheetDisplayName>
</PropertyGroup>
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros">
<!-- other user macros -->
<OutDir> ... </OutDir>
<IntDir> ... </IntDir>
</PropertyGroup>
<!-- rest of .props file --->
Project.vcxproj
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- ... -->
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<!-- include custom .props here, can also use full or relative path -->
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="Directory.Build.props" />
</ImportGroup>
<!-- ... -->
I'm trying to build the application that uses libzip.
I build the libzip library first and got zip.lib and zip.dll.
Now on the linking stage I get an error
Error LNK1104 cannot open file 'zip.lib'
It seems that AdditionalLibraryDirectories is ignores whereas AdditionalIncludeDirectories works well (all zip-related headers are found)
settings.props:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)\libzip\lib;$(SolutionDir)\libzip\build;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(SolutionDir)\libzip\build\lib\Debug</AdditionalLibraryDirectories>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;zip.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup />
</Project>
If I add "$(SolutionDir)\libzip\build\lib\Debug\" to Additional library directories of the project, everything works! So the zip library is not corrupted.
I'm using the following extension.vsixmanifest file to create my vsix package:
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="774e58ba-f1b9-40a7-b676-834fa2c220fe" Version="1.0" Language="en-US" Publisher="Me" />
<DisplayName>MyProduct</DisplayName>
<Description xml:space="preserve">Description of my product</Description>
<Icon>App.ico</Icon>
</Metadata>
<Installation AllUsers="true">
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[11.0, 17.0)" />
<InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[11.0, 17.0)" />
<InstallationTarget Id="Microsoft.VisualStudio.Enterprise" Version="[11.0, 17.0)"/>
</Installation>
<Dependencies>
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" Version="[4.5,)" />
</Dependencies>
</PackageManifest>
When I try to install targeting Visual Studio 2017 or Visual Studio 2019, I'm getting the following message:
Someone knows how could I address this issue?
You need <Prerequisites> section in the manifest:
At a minimum, all extensions should specify the Visual Studio core
editor component as a prerequisite.
I am upgrading some big solution files (80 projects) from Visual Studio 2010 to Visual Studio 2017. I allowed VS to upgrade the solution and project files (they are all VC++ projects).
If you go to the "Linker" settings for the project, they are all set to generate an intermediate manifest.
I am running VS2017 as Administrator, and for each of the projects I try to build, I get an error similar to:
LINK : fatal error LNK1104: cannot open file 'D:...\intel_win32_Debug\bundle_creator\bundle_creator.exe.intermediate.manifest'
This works fine building the projects in VS2010. In VS 2010, the intermediate manifest is produced and feeds the manifest tool, and the projects build. The output directory exists and has intermediate .obj files, as well as a .pdb file. I also checked the directory privileges and ownership, and they appear to be in order.
This error happens for both debug/release builds.
Does anyone know why this would work in 2010 but not in 2017?
EDIT: There is NO content in the linker trace log files. (Whereas plenty when done in VS2017). Here is a sample project file.
EDIT 2: One huge difference I see is that in the VS2010 case I see trace logs for the mt.ext manifest tool, whereas in 2017 I don't. So it appears like the manifest tool isn't running for some reason. The manifest settings haven't changed - is there some setting in VS2017 for running the manifest tool before the linker?
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Template|Win32">
<Configuration>Template</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{FAA8F144-2DE8-4397-B694-FDA2BF43E610}</ProjectGuid>
<RootNamespace>bundle_creator</RootNamespace>
<SccProjectName>
</SccProjectName>
<SccAuxPath>
</SccAuxPath>
<SccLocalPath>
</SccLocalPath>
<SccProvider>
</SccProvider>
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\..\build\properties\release.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\..\build\properties\debug.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(CORE_LIBRARIES_DIR)\3rdParty\zlib\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>CONSOLE_MODE;OMIT_CRYPTO_SUPPORT=t;OMIT_SYSTEM_VALUES=t;_CONSOLE;__BUILD_STATIC_APPLICATION__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>CONSOLE_MODE;OMIT_CRYPTO_SUPPORT=t;OMIT_SYSTEM_VALUES=t;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(CORE_LIBRARIES_DIR)\3rdparty\zlib\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(CORE_LIBRARIES_DIR)\3rdparty\zlib\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>CONSOLE_MODE;OMIT_CRYPTO_SUPPORT=t;OMIT_SYSTEM_VALUES=t;_CONSOLE;__BUILD_STATIC_APPLICATION__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>CONSOLE_MODE;OMIT_CRYPTO_SUPPORT=t;OMIT_SYSTEM_VALUES=t;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(CORE_LIBRARIES_DIR)\3rdparty\zlib\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="bundle_creator.cpp" />
<ClCompile Include="common_bundle.cpp" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="bundler_version.rc" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\..\libraries\core\library\basis\basis.vcxproj">
<Project>{571b0731-ed86-476a-a723-9ecf75cb0d51}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\build_prerequisites.csproj">
<Project>{28ba1c03-7e39-4ce2-993f-72a7772fa758}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<ProjectExtensions>
<VisualStudio>
<UserProperties RESOURCE_FILE="bundler_version.rc" />
</VisualStudio>
</ProjectExtensions>
</Project>
And here is the debug property sheet
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="UserMacros">
<REPOSITORY_DIR Condition="'$(REPOSITORY_DIR)'==''">$(SolutionDir)</REPOSITORY_DIR>
<BUILDER_DIR>$(REPOSITORY_DIR)\..\..\build\</BUILDER_DIR>
<BUILD_TOP>$(REPOSITORY_DIR)\..\..\</BUILD_TOP>
<LIBRARIES_DIR>$(REPOSITORY_DIR)\..\..\libraries\</LIBRARIES_DIR>
<CORE_LIBRARIES_DIR>$(REPOSITORY_DIR)\..\..\libraries\core\</CORE_LIBRARIES_DIR>
<SHARED_LIBRARIES_DIR>$(REPOSITORY_DIR)\..\..\libraries\shared\</SHARED_LIBRARIES_DIR>
</PropertyGroup>
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir>$(REPOSITORY_DIR)\binaries\</OutDir>
</PropertyGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(BUILDER_DIR)\properties\vcoptions.props" />
</ImportGroup>
<ItemDefinitionGroup>
<Midl>
<PreprocessorDefinitions>DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<WholeProgramOptimization>false</WholeProgramOptimization>
<PreprocessorDefinitions>_DEBUG;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<StringPooling>false</StringPooling>
<FunctionLevelLinking>false</FunctionLevelLinking>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Manifest>
<AdditionalManifestFiles>$(IntDir)$(TargetFileName).intermediate.manifest;$(BUILDER_DIR)\properties\security_manifest.txt;%(AdditionalManifestFiles)</AdditionalManifestFiles>
</Manifest>
<Link>
<AdditionalLibraryDirectories>$(REPOSITORY_DIR)\binaries;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ProgramDatabaseFile>$(REPOSITORY_DIR)\binaries\$(TargetName).pdb</ProgramDatabaseFile>
<ImportLibrary>$(REPOSITORY_DIR)\binaries\$(ProjectName).lib</ImportLibrary>
<AdditionalDependencies>msvcrtd.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>msvcrt.lib;mfc.lib</IgnoreSpecificDefaultLibraries>
</Link>
</ItemDefinitionGroup>
</Project>
I'm new to any of open framework(I'm a solution engineer based on java) and trying to build a cxf project.
I understand that I need to have applicationContext.xml file and contents something like
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:cxf="http://cxf.apache.org/core" xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:http-conf="http://cxf.apache.org/transports/http/configuration"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd">
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<http-conf:conduit name="*.http-conduit">
<http-conf:client ReceiveTimeout=“300000“ AllowChunking="false"/>
</http-conf:conduit>
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<cxf:bus>
<cxf:features>
<cxf:logging />
</cxf:features>
</cxf:bus>
</beans>
in it.
I now wonder where I can download
cxf/cxf.xml, cxf-extension-soap.xml, cxf-servlet.xml files.
Or that I created a Dynamic Web Project is wrong? Does some other project type automatically generates those files?
I know this is an old post, but this might help others
cxf-extension-soap.xml is in cxf-rt-binding-soap jar, but you will need cxf-rt-frontend-jaxws
cxf-servlet.xml is in cxf-rt-transports-http jar
cxf.xml is in cxf-rt-core jar (which is a transitive dependency of the above ones)
Therefore, if you include cxf-rt-frontend-jaxws and cxf-rt-transports-http as dependencies (with Maven, for example) your project should work correctly.
Each of these files can be found in the CXF jars that you'll need to include with your project.
cxf-servlet.xml
cxf.xml
cxf-extension-soap.xml
I've always found the fastest way to getting a CXF project up and running is to use a Maven Archetype.
Or that I created a Dynamic Web Project is wrong? Does some other project type automatically generates those files?
The war file you create will generally just have a manifest file under META-INF directory called MANIFEST.MF. This file has your build meta information. For me I have
Manifest-Version: 1.0
Gradle-Version: 2.0-rc-2
Created-By: 1.6.0_31 (Sun Microsystems Inc.)
Version: 10.51
Build: dev
Build-Timestamp: 10/01/2015 12:53:32
Build-User: athakur
Build-Host: ATHAKUR
This directory is automatically created when you build your project to create a jar or a war. It can have other attributes as well like the main class [Refer this Q].
Now coming to your question. Many libraries put their configuration files in the corresponding jars META-INF folder. This is just another example and the jars you are looking for are CXF jars.
For gradle you can add following in your build.gradle file
compile("org.apache.cxf:cxf-rt-frontend-jaxrs:3.1.3")
compile("org.apache.cxf:cxf-rt-frontend-jaxws:3.1.3")
compile("org.apache.cxf:cxf-rt-transports-http:3.1.3")
This is an old post but it still comes up for people migrating old CXF to newer. And what I'm finding is that cxf-rt-bindings-soap-3.1.7.jar no longer has classpath:META-INF/cxf/cxf-extension-soap.xml
see this: REST CXF and Spring cxf-extension-jaxrs-binding File not found exception?
the cxf-extension-http.xml and cxf-extension-soap.xml for the version 3.2.X of cxf you just need to include this line cxf-extension-jaxws.xml
Web.xml can be like this
CXF
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:ApplicationContext-cxf.xml</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<servlet>
<servlet-name>CXFServlet</servlet-name>
<display-name>CXF Servlet</display-name>
<servlet-class>
org.apache.cxf.transport.servlet.CXFServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
Following is a working ApplicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:cxf="http://cxf.apache.org/core" xmlns:task="http://www.springframework.org/schema/task"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.1.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.1.xsd">
<import resource="classpath:META-INF/cxf/cxf.xml"/>
<import resource="classpath:META-INF/cxf/cxf-extension-xml.xml"/>
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<task:annotation-driven />
<context:component-scan base-package="com.smoothexample">
<context:include-filter type="annotation"
expression="org.springframework.stereotype.Service" />
<context:include-filter type="annotation"
expression="org.springframework.stereotype.Component" />
<context:include-filter type="annotation"
expression="org.springframework.stereotype.Repository" />
</context:component-scan>
<context:annotation-config />
<context:component-scan base-package="com.smoothexample" />
<bean
class="org.springframework.context.annotation.CommonAnnotationBeanPostProcessor" />
<bean id="addressSoapService" class="com.smoothexample.cxf.soap.ws.impl.AddressSoapServiceImpl" />
<jaxws:endpoint id="addressEndpointId"
implementorClass="com.smoothexample.cxf.soap.ws.impl.AddressSoapServiceImpl"
implementor="#addressSoapService" address="/addressSoapService">
</jaxws:endpoint>
</beans>
All the maven dependencies are defined as follows, which includes jars for cxf/cxf.xml, cxf-extension-soap.xml, cxf-servlet.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.lal.pro</groupId>
<artifactId>apache-cxf-soap-ws</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>apache-cxf-soap-ws Maven Webapp</name>
<url>http://maven.apache.org</url>
<properties>
<cxf.version>2.5.0</cxf.version>
<org.springframework.version>4.1.1.RELEASE</org.springframework.version>
<ch.qos.logback.version>1.1.3</ch.qos.logback.version>
<org.sl4j.version>1.7.12</org.sl4j.version>
<spring.ws.version>2.2.4.RELEASE</spring.ws.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.1</version>
</dependency>
</dependencies>
<build>
<finalName>apache-cxf-soap-ws</finalName>
</build>
</project>
Please find more details at http://www.smoothexample.com/webservices/apache_cxf_soap_web_services.html