Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build-tools/create-vsix/create-vsix.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ProjectGuid>{94756FEB-1F64-411D-A18E-81B5158F776A}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>Xamarin.Android.Sdk</RootNamespace>
<AssemblyName>Xamarin.Android.Sdk</AssemblyName>
<AssemblyName>Xamarin.Android.Sdk-OSS</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<CreateVsixContainer Condition=" '$(CreateVsixContainer)' == '' ">False</CreateVsixContainer>
<CopyBuildOutputToOutputDirectory>False</CopyBuildOutputToOutputDirectory>
Expand Down
58 changes: 16 additions & 42 deletions build-tools/create-vsix/create-vsix.targets
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask AssemblyFile="..\..\bin\Build$(Configuration)\xa-prep-tasks.dll" TaskName="Xamarin.Android.BuildTools.PrepTasks.GitBlame" />
<UsingTask AssemblyFile="..\..\bin\Build$(Configuration)\xa-prep-tasks.dll" TaskName="Xamarin.Android.BuildTools.PrepTasks.GitBranch" />
<UsingTask AssemblyFile="..\..\bin\Build$(Configuration)\xa-prep-tasks.dll" TaskName="Xamarin.Android.BuildTools.PrepTasks.GitCommitHash" />
<UsingTask AssemblyFile="..\..\bin\Build$(Configuration)\xa-prep-tasks.dll" TaskName="Xamarin.Android.BuildTools.PrepTasks.GitCommitsInRange" />
<Import Project="..\scripts\XAVersionInfo.targets" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we missing this file? I can't see it in the PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<UsingTask AssemblyFile="..\..\bin\Build$(Configuration)\xa-prep-tasks.dll" TaskName="Xamarin.Android.BuildTools.PrepTasks.ReplaceFileContents" />
<PropertyGroup>
<!-- Don't ever deploy, since that won't work on Mac -->
Expand Down Expand Up @@ -81,7 +78,7 @@
</ItemGroup>
</Target>
<Target Name="GetVsixVersion"
DependsOnTargets="_GetVersionInfo"
DependsOnTargets="GetXAVersionInfo"
Returns="$(VsixVersion)">
<PropertyGroup>
<VsixVersion>$(ProductVersion).$(_XACommitCount)</VsixVersion>
Expand All @@ -94,57 +91,34 @@
<IsExperimental Condition=" '$(IsProductComponent)' == 'True' ">false</IsExperimental>
</PropertyGroup>
</Target>
<Target Name="_GetVersionInfo">
<GitBlame
FileName="$(XamarinAndroidSourcePath)\Configuration.props"
LineFilter="&lt;ProductVersion&gt;"
WorkingDirectory="$(XamarinAndroidSourcePath)"
ToolPath="$(GitToolPath)"
ToolExe="$(GitToolExe)">
<Output TaskParameter="Commits" ItemName="_XAVersionCommit" />
</GitBlame>
<GitCommitsInRange
StartCommit="%(_XAVersionCommit.CommitHash)"
WorkingDirectory="$(XamarinAndroidSourcePath)"
ToolPath="$(GitToolPath)"
ToolExe="$(GitToolExe)">
<Output TaskParameter="CommitCount" PropertyName="_XACommitCount" />
</GitCommitsInRange>
<GitCommitHash
WorkingDirectory="$(XamarinAndroidSourcePath)"
ToolPath="$(GitToolPath)"
ToolExe="$(GitToolExe)">
<Output TaskParameter="AbbreviatedCommitHash" PropertyName="_XAHash" />
</GitCommitHash>
<GitBranch
WorkingDirectory="$(XamarinAndroidSourcePath)"
ToolPath="$(GitToolPath)"
ToolExe="$(GitToolExe)">
<Output TaskParameter="Branch" PropertyName="_XABranch" />
</GitBranch>
</Target>
<Target Name="_CreateDependencies"
DependsOnTargets="_GetVersionInfo"
DependsOnTargets="GetXAVersionInfo"
BeforeTargets="Build"
Inputs="Xamarin.Android.Sdk.pkgdef.in"
Outputs="Xamarin.Android.Sdk.pkgdef">
<ReplaceFileContents
SourceFile="Xamarin.Android.Sdk.pkgdef.in"
DestinationFile="Xamarin.Android.Sdk.pkgdef"
Replacements="@PACKAGE_VERSION@=$(ProductVersion);@PACKAGE_VERSION_BUILD@=$(_XACommitCount);@PACKAGE_HEAD_REV@=$(_XAHash);@PACKAGE_HEAD_BRANCH@=$(_XABranch)">
Replacements="@PACKAGE_VERSION@=$(ProductVersion);@PACKAGE_VERSION_BUILD@=$(XAVersionCommitCount);@PACKAGE_HEAD_REV@=$(XAVersionHash);@PACKAGE_HEAD_BRANCH@=$(XAVersionBranch)">
</ReplaceFileContents>
</Target>
<Target Name="_CopyToBuildConfiguration"
DependsOnTargets="_GetVersionInfo"
Inputs="$(OutputPath)$(AssemblyName).vsix"
Outputs="..\..\bin\Build$(Configuration)\$(AssemblyName).vsix">
<Target Name="_GetVsixPath"
DependsOnTargets="GetXAVersionInfo">
<PropertyGroup>
<_Branch>$(_XABranch.Replace ('/', '-'))</_Branch>
<_Branch>$(XAVersionBranch.Replace ('/', '-'))</_Branch>
<_Branch>$(_Branch.Replace ('\', '-'))</_Branch>
</PropertyGroup>
<PropertyGroup>
<VsixPath Condition=" '$(VsixPath)' == '' ">..\..\bin\Build$(Configuration)\$(AssemblyName)-$(ProductVersion).$(XAVersionCommitCount)_$(XAVersionBranch)_$(XAVersionHash).vsix</VsixPath>
</PropertyGroup>
</Target>
<Target Name="_CopyToBuildConfiguration"
DependsOnTargets="_GetVsixPath"
Inputs="$(OutputPath)$(AssemblyName).vsix"
Outputs="$(VsixPath)">
<Copy
SourceFiles="$(OutputPath)$(AssemblyName).vsix"
DestinationFiles="..\..\bin\Build$(Configuration)\$(AssemblyName)-$(ProductVersion).$(_XACommitCount)_$(_Branch)_$(_XAHash).vsix"
DestinationFiles="$(VsixPath)"
/>
</Target>
</Project>
9 changes: 8 additions & 1 deletion build-tools/scripts/BuildEverything.mk
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,14 @@ _BUNDLE_ZIPS_EXCLUDE = \

create-vsix:
$(foreach conf, $(CONFIGURATIONS), \
MONO_IOMAP=all MONO_OPTIONS=--arch=64 msbuild $(MSBUILD_FLAGS) build-tools/create-vsix/create-vsix.csproj /p:Configuration=$(conf) /p:CreateVsixContainer=True ; )
MONO_IOMAP=all MONO_OPTIONS=--arch=64 msbuild $(MSBUILD_FLAGS) /p:Configuration=$(conf) /p:CreateVsixContainer=True \
build-tools/create-vsix/create-vsix.csproj \
$(if $(VSIX),"/p:VsixPath=$(VSIX)") \
$(if $(PRODUCT_COMPONENT),/p:IsProductComponent="$(PRODUCT_COMPONENT)") \
$(if $(PACKAGE_VERSION),/p:ProductVersion="$(PACKAGE_VERSION)") \
$(if $(PACKAGE_HEAD_BRANCH),/p:XAVersionBranch="$(PACKAGE_HEAD_BRANCH)") \
$(if $(PACKAGE_VERSION_REV),/p:XAVersionCommitCount="$(PACKAGE_VERSION_REV)") \
$(if $(COMMIT),/p:XAVersionHash="$(COMMIT)") ; )

package-oss-name:
@echo ZIP_OUTPUT=$(ZIP_OUTPUT)
Expand Down