Skip to content

Commit

Permalink
[build] Remove proguard submodule and use nupkg (#6983)
Browse files Browse the repository at this point in the history
* Bump to Guardsquare/proguard@b4ab30a5 [v7.1.1]

Bump from ProGuard v7.0.1 to v7.1.1.

Changes: Guardsquare/proguard@912d149...b4ab30a

Attempts to build proguard without a cache in place have been failing:

    FAILURE: Build failed with an exception.

    * What went wrong:
    Could not determine the dependencies of task ':base:fatJar'.
    > Could not resolve all dependencies for configuration ':base:runtime'.
        > Could not resolve com.guardsquare:proguard-core:7.0.1.
        Required by:
            project :base
            > Could not resolve com.guardsquare:proguard-core:7.0.1.
            > Could not get resource 'https://jcenter.bintray.com/com/guardsquare/proguard-core/7.0.1/proguard-core-7.0.1.module'.
                > Could not GET 'https://jcenter.bintray.com/com/guardsquare/proguard-core/7.0.1/proguard-core-7.0.1.module'.
                    > Read timed out

Proguard v7.1.0 [moves from jcenter to Maven Central][0], which should
fix this issue.

[0]: Guardsquare/proguard@87000a4

* Remove proguard submodule, use nupkg

* Remove external/proguard references

* Fix line endings
  • Loading branch information
pjcollins authored May 5, 2022
1 parent bec6e06 commit d8f8486
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 62 deletions.
5 changes: 0 additions & 5 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@
path = external/opentk
url = https://github.com/mono/opentk.git
branch = main
[submodule "external/proguard"]
path = external/proguard
url = https://github.com/Guardsquare/proguard.git
branch = master
ignore = dirty
[submodule "external/robin-map"]
path = external/robin-map
url = https://github.com/Tessil/robin-map.git
Expand Down
2 changes: 0 additions & 2 deletions Configuration.props
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@
<MingwZlibRootDirectory32>$(MingwZlibRootDirectory)\i686-w64-mingw32</MingwZlibRootDirectory32>
<MingwZlibRootDirectory64>$(MingwZlibRootDirectory)\x86_64-w64-mingw32</MingwZlibRootDirectory64>
<MingwZlibLibraryName>libz.a</MingwZlibLibraryName>
<ProGuardSourceDirectory Condition=" '$(ProGuardSourceDirectory)' == '' ">$(MSBuildThisFileDirectory)external\proguard</ProGuardSourceDirectory>
<SqliteSourceDirectory Condition=" '$(SqliteSourceDirectory)' == '' ">$(MSBuildThisFileDirectory)external\sqlite</SqliteSourceDirectory>
<XamarinAndroidSourcePath>$(MSBuildThisFileDirectory)</XamarinAndroidSourcePath>
<ThirdPartySourcePath>$(MSBuildThisFileDirectory)src-ThirdParty\</ThirdPartySourcePath>
Expand Down Expand Up @@ -168,7 +167,6 @@
<LinkerSourceFullPath>$([System.IO.Path]::GetFullPath ('$(LinkerSourceDirectory)'))</LinkerSourceFullPath>
<SqliteSourceFullPath>$([System.IO.Path]::GetFullPath ('$(SqliteSourceDirectory)'))</SqliteSourceFullPath>
<OpenTKSourceFullPath>$([System.IO.Path]::GetFullPath ('$(OpenTKSourceDirectory)'))</OpenTKSourceFullPath>
<ProGuardSourceFullPath>$([System.IO.Path]::GetFullPath ('$(ProGuardSourceDirectory)'))</ProGuardSourceFullPath>
</PropertyGroup>
<PropertyGroup>
<AdbToolPath Condition=" '$(AdbToolPath)' == '' ">$(AndroidSdkFullPath)\platform-tools\</AdbToolPath>
Expand Down
8 changes: 0 additions & 8 deletions build-tools/automation/CredScanSuppressions.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@
{
"file": "external\\android-api-docs\\docs\\Mono.Android\\en\\Javax.Crypto.Interfaces\\IPBEKey.xml",
"_justification": "Android API documentation, does not contain a password."
},
{
"file": "external\\proguard\\examples\\android\\debug.keystore",
"_justification": "Dummy keystore file from a proguard example."
},
{
"file": "external\\proguard\\examples\\android-plugin\\debug.keystore",
"_justification": "Dummy keystore file from a proguard example."
}
]
}
1 change: 0 additions & 1 deletion build-tools/create-vsix/VSPackage.resx.in
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@
<value>Xamarin.Android Reference Assemblies and MSBuild support.
Mono: @MONO_COMMIT@
Java.Interop: @JAVA_INTEROP_COMMIT@
ProGuard: @PROGUARD_COMMIT@
SQLite: @SQLITE_COMMIT@
Xamarin.Android Tools: @XAMARIN_ANDROID_TOOLS_COMMIT@
</value>
Expand Down
4 changes: 2 additions & 2 deletions build-tools/create-vsix/create-vsix.targets
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@
<ReplaceFileContents
SourceFile="Xamarin.Android.Sdk.pkgdef.in"
DestinationFile="Xamarin.Android.Sdk.pkgdef"
Replacements="@PACKAGE_VERSION@=$(ProductVersion);@PACKAGE_VERSION_BUILD@=$(XAVersionCommitCount);@PACKAGE_HEAD_REV@=$(XAVersionHash);@PACKAGE_HEAD_BRANCH@=$(XAVersionBranch);@MONO_COMMIT@=$(_BuildInfo_MonoCommit);@JAVA_INTEROP_COMMIT@=$(_BuildInfo_JavaInteropCommit);@PROGUARD_COMMIT@=$(_BuildInfo_ProguardCommit);@SQLITE_COMMIT@=$(_BuildInfo_SqliteCommit);@XAMARIN_ANDROID_TOOLS_COMMIT@=$(_BuildInfo_XamarinAndroidToolsCommit);">
Replacements="@PACKAGE_VERSION@=$(ProductVersion);@PACKAGE_VERSION_BUILD@=$(XAVersionCommitCount);@PACKAGE_HEAD_REV@=$(XAVersionHash);@PACKAGE_HEAD_BRANCH@=$(XAVersionBranch);@MONO_COMMIT@=$(_BuildInfo_MonoCommit);@JAVA_INTEROP_COMMIT@=$(_BuildInfo_JavaInteropCommit);@SQLITE_COMMIT@=$(_BuildInfo_SqliteCommit);@XAMARIN_ANDROID_TOOLS_COMMIT@=$(_BuildInfo_XamarinAndroidToolsCommit);">
</ReplaceFileContents>

<ReplaceFileContents
SourceFile="VSPackage.resx.in"
DestinationFile="VSPackage.resx"
Replacements="@MONO_COMMIT@=$(_BuildInfo_MonoCommit);@JAVA_INTEROP_COMMIT@=$(_BuildInfo_JavaInteropCommit);@PROGUARD_COMMIT@=$(_BuildInfo_ProguardCommit);@SQLITE_COMMIT@=$(_BuildInfo_SqliteCommit);@XAMARIN_ANDROID_TOOLS_COMMIT@=$(_BuildInfo_XamarinAndroidToolsCommit);">
Replacements="@MONO_COMMIT@=$(_BuildInfo_MonoCommit);@JAVA_INTEROP_COMMIT@=$(_BuildInfo_JavaInteropCommit);@SQLITE_COMMIT@=$(_BuildInfo_SqliteCommit);@XAMARIN_ANDROID_TOOLS_COMMIT@=$(_BuildInfo_XamarinAndroidToolsCommit);">
</ReplaceFileContents>
</Target>
<Target Name="_GetVsixPath"
Expand Down
3 changes: 0 additions & 3 deletions build-tools/scripts/XAVersionInfo.targets
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
<_SubmoduleBranchInfo Include="external/Java.Interop">
<OutputPropertyName>_BuildInfo_JavaInteropCommit</OutputPropertyName>
</_SubmoduleBranchInfo>
<_SubmoduleBranchInfo Include="external/proguard">
<OutputPropertyName>_BuildInfo_ProguardCommit</OutputPropertyName>
</_SubmoduleBranchInfo>
<_SubmoduleBranchInfo Include="external/sqlite">
<OutputPropertyName>_BuildInfo_SqliteCommit</OutputPropertyName>
</_SubmoduleBranchInfo>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ protected override async Task<bool> Execute (Context context)
testAreas.Add ("Designer");
}

if (file.Contains ("external/proguard")) {
testAreas.Add ("MSBuild");
testAreas.Add ("MSBuildDevice");
}

if (file.Contains ("external/sqlite")) {
testAreas.Add ("MSBuildDevice");
}
Expand Down
1 change: 0 additions & 1 deletion external/proguard
Submodule proguard deleted from 912d14
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
<ReplaceFileContents
SourceFile="Xamarin.Android.BuildInfo.txt.in"
DestinationFile="Xamarin.Android.BuildInfo.txt"
Replacements="@MONO_COMMIT@=$(_BuildInfo_MonoCommit);@JAVA_INTEROP_COMMIT@=$(_BuildInfo_JavaInteropCommit);@PROGUARD_COMMIT@=$(_BuildInfo_ProguardCommit);@SQLITE_COMMIT@=$(_BuildInfo_SqliteCommit);@XAMARIN_ANDROID_TOOLS_COMMIT@=$(_BuildInfo_XamarinAndroidToolsCommit);">
Replacements="@MONO_COMMIT@=$(_BuildInfo_MonoCommit);@JAVA_INTEROP_COMMIT@=$(_BuildInfo_JavaInteropCommit);@SQLITE_COMMIT@=$(_BuildInfo_SqliteCommit);@XAMARIN_ANDROID_TOOLS_COMMIT@=$(_BuildInfo_XamarinAndroidToolsCommit);">
</ReplaceFileContents>
<ReplaceFileContents
SourceFile="Xamarin.Android.Common.props.in"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@
#
Mono: @MONO_COMMIT@
Java.Interop: @JAVA_INTEROP_COMMIT@
ProGuard: @PROGUARD_COMMIT@
SQLite: @SQLITE_COMMIT@
Xamarin.Android Tools: @XAMARIN_ANDROID_TOOLS_COMMIT@
12 changes: 9 additions & 3 deletions src/proguard/proguard.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@
<TargetFramework>netstandard2.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>

<Import Project="..\..\Configuration.props" />


<!-- https://dev.azure.com/xamarin/public/_artifacts/feed/Xamarin.Android/NuGet/Xamarin.Android.Proguard/12.3.1%20sha.bbba5a2/overview
https://github.com/Guardsquare/proguard/commit/912d149394fc96072905735649327d4101980832 -->
<ItemGroup>
<PackageReference Include="Xamarin.Android.Proguard" Version="12.3.1" GeneratePathProperty="true" />
</ItemGroup>

<PropertyGroup>
<OutputPath>$(XAInstallPrefix)xbuild\Xamarin\Android\proguard\</OutputPath>
</PropertyGroup>

<Import Project="proguard.targets" />
</Project>
39 changes: 9 additions & 30 deletions src/proguard/proguard.targets
Original file line number Diff line number Diff line change
@@ -1,48 +1,27 @@
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_InputJar>$(PkgXamarin_Android_Proguard)\proguard\lib\proguard.jar</_InputJar>
<_OutputJar>$(OutputPath)lib/proguard.jar</_OutputJar>
<_InputBat>$(PkgXamarin_Android_Proguard)\proguard\\bin\proguard.bat</_InputBat>
<_OutputBat>$(OutputPath)bin\proguard.bat</_OutputBat>
<_InputSh>$(PkgXamarin_Android_Proguard)\proguard\bin\proguard.sh</_InputSh>
<_OutputSh>$(OutputPath)bin/proguard.sh</_OutputSh>
<_InputLicense>$(PkgXamarin_Android_Proguard)\proguard\license.md</_InputLicense>
<_OutputLicense>$(OutputPath)license.md</_OutputLicense>
</PropertyGroup>
<ItemGroup>
<_Inputs Include="$(_InputJar);$(_InputBat);$(_InputSh);$(_InputLicense)" />
<_Outputs Include="$(_OutputJar);$(_OutputBat);$(_OutputSh);$(_OutputLicense)" />
</ItemGroup>
<Target Name="_BuildProGuard"
<Target Name="_CopyProGuard"
BeforeTargets="Build"
Inputs="$(MSBuildThisFile)"
Inputs="$(MSBuildThisFile);@(_Inputs)"
Outputs="@(_Outputs)">
<Exec
Command="&quot;../gradlew&quot; fatJar $(GradleArgs)"
EnvironmentVariables="JAVA_HOME=$(Java8SdkDirectory);APP_HOME=$(GradleHome)"
WorkingDirectory="$(ProGuardSourceFullPath)/base"
/>
<MakeDir Directories="$(OutputPath)" />
<Copy
SourceFiles="../../external/proguard/lib/proguard.jar"
DestinationFiles="$(_OutputJar)"
/>
<Copy
SourceFiles="../../external/proguard/bin/proguard.bat"
DestinationFiles="$(_OutputBat)"
/>
<Copy
SourceFiles="../../external/proguard/bin/proguard.sh"
DestinationFiles="$(_OutputSh)"
/>
<Copy
SourceFiles="../../external/proguard/docs/md/license.md"
DestinationFiles="$(_OutputLicense)"
SourceFiles="@(_Inputs)"
DestinationFiles="@(_Outputs)"
/>
<Touch Files="@(_Outputs)" />
</Target>
<Target Name="_CleanProGuard" BeforeTargets="Clean">
<Delete Files="@(_Outputs)" />
<Exec
Command="&quot;$(GradleWPath)&quot; clean $(GradleArgs)"
EnvironmentVariables="JAVA_HOME=$(Java8SdkDirectory);APP_HOME=$(GradleHome)"
WorkingDirectory="$(ProGuardSourceFullPath)/base"
/>
</Target>
<Target Name="CoreCompile" />
</Project>

0 comments on commit d8f8486

Please sign in to comment.