Skip to content

[build] Download correct mono archive URL #2389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 9, 2018
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
79 changes: 0 additions & 79 deletions src/mono-runtimes/ProfileAssemblies.projitems
Original file line number Diff line number Diff line change
Expand Up @@ -191,83 +191,4 @@
<MonoProfileAssembly Include="System.Xml.Linq.dll" />
<MonoProfileAssembly Include="System.Xml.Serialization.dll" />
</ItemGroup>
<ItemGroup>
<MonoTestAssembly Include="monodroid_corlib_test.dll">
<SourcePath>corlib</SourcePath>
</MonoTestAssembly>
<MonoTestAssembly Include="monodroid_corlib_xunit-test.dll">
<SourcePath>corlib</SourcePath>
<TestType>xunit</TestType>
</MonoTestAssembly>
<MonoTestAssembly Include="monodroid_I18N.CJK_test.dll">
<SourcePath>I18N/CJK</SourcePath>
</MonoTestAssembly>
<MonoTestAssembly Include="monodroid_I18N.MidEast_test.dll">
<SourcePath>I18N/MidEast</SourcePath>
</MonoTestAssembly>
<MonoTestAssembly Include="monodroid_I18N.West_test.dll">
<SourcePath>I18N/West</SourcePath>
</MonoTestAssembly>
<MonoTestAssembly Include="monodroid_Mono.CSharp_test.dll">
<SourcePath>Mono.CSharp</SourcePath>
</MonoTestAssembly>
<MonoTestAssembly Include="monodroid_Mono.Data.Sqlite_test.dll">
<SourcePath>Mono.Data.Sqlite</SourcePath>
</MonoTestAssembly>
<MonoTestAssembly Include="monodroid_Mono.Data.Tds_test.dll">
<SourcePath>Mono.Data.Tds</SourcePath>
</MonoTestAssembly>
<MonoTestAssembly Include="monodroid_Mono.Security_test.dll">
<SourcePath>Mono.Security</SourcePath>
</MonoTestAssembly>
<MonoTestAssembly Include="monodroid_System_test.dll">
<SourcePath>System</SourcePath>
</MonoTestAssembly>
<MonoTestAssembly Include="monodroid_System.Core_test.dll">
<SourcePath>System.Core</SourcePath>
</MonoTestAssembly>
<MonoTestAssembly Include="monodroid_System.Data_test.dll">
<SourcePath>System.Data</SourcePath>
</MonoTestAssembly>
<MonoTestAssembly Include="monodroid_System.IO.Compression.FileSystem_test.dll">
<SourcePath>System.IO.Compression.FileSystem</SourcePath>
</MonoTestAssembly>
<MonoTestAssembly Include="monodroid_System.IO.Compression_test.dll">
<SourcePath>System.IO.Compression</SourcePath>
</MonoTestAssembly>
<MonoTestAssembly Include="monodroid_System.Json_test.dll">
<SourcePath>System.Json</SourcePath>
</MonoTestAssembly>
<MonoTestAssembly Include="monodroid_System.Net.Http_test.dll">
<SourcePath>System.Net.Http</SourcePath>
</MonoTestAssembly>
<MonoTestAssembly Include="monodroid_System.Numerics_test.dll">
<SourcePath>System.Numerics</SourcePath>
</MonoTestAssembly>
<MonoTestAssembly Include="monodroid_System.Numerics_xunit-test.dll">
<SourcePath>System.Numerics</SourcePath>
<TestType>xunit</TestType>
</MonoTestAssembly>
<MonoTestAssembly Include="monodroid_System.Runtime.Serialization_test.dll">
<SourcePath>System.Runtime.Serialization</SourcePath>
</MonoTestAssembly>
<MonoTestAssembly Include="monodroid_System.ServiceModel.Web_test.dll">
<SourcePath>System.ServiceModel.Web</SourcePath>
</MonoTestAssembly>
<MonoTestAssembly Include="monodroid_System.Transactions_test.dll">
<SourcePath>System.Transactions</SourcePath>
</MonoTestAssembly>
<MonoTestAssembly Include="monodroid_System.Xml_test.dll">
<SourcePath>System.XML</SourcePath>
</MonoTestAssembly>
<MonoTestAssembly Include="monodroid_System.Xml.Linq_test.dll">
<SourcePath>System.Xml.Linq</SourcePath>
</MonoTestAssembly>
<MonoTestAssembly Include="System.Runtime.CompilerServices.Unsafe.dll">
<!-- This is referenced by monodroid_corlib_xunit-test.dll -->
<SourcePath>System.Runtime.CompilerServices.Unsafe</SourcePath>
<TestType>reference</TestType>
</MonoTestAssembly>
<MonoTestRunner Include="nunitlite.dll" />
</ItemGroup>
</Project>
99 changes: 33 additions & 66 deletions src/mono-runtimes/mono-runtimes.targets
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<MonoDocCopyItem Include="monodoc.dll.config" />
</ItemGroup>
<UsingTask AssemblyFile="$(_SourceTopDir)\bin\Build$(Configuration)\Xamarin.Android.Tools.BootstrapTasks.dll" TaskName="Xamarin.Android.Tools.BootstrapTasks.GetNugetPackageBasePath" />
<UsingTask AssemblyFile="$(_SourceTopDir)\bin\Build$(Configuration)\Xamarin.Android.Tools.BootstrapTasks.dll" TaskName="Xamarin.Android.Tools.BootstrapTasks.UnzipDirectoryChildren" />
<ItemGroup>
<_MonoDocCopyItems Include="@(MonoDocCopyItem->'$(_MonoProfileToolsDir)\%(Identity)')" />
</ItemGroup>
Expand All @@ -48,6 +49,9 @@

<_MonoSdksParameters>CONFIGURATION=$(_MonoSdksConfiguration) IGNORE_PROVISION_MXE=true IGNORE_PROVISION_ANDROID=true ANDROID_TOOLCHAIN_DIR=&quot;$(_MonoSdksAndroidToolchainDir)&quot; ANDROID_TOOLCHAIN_CACHE_DIR=&quot;$(_MonoSdksAndroidToolchainCacheDir)&quot; ANDROID_TOOLCHAIN_PREFIX=&quot;$(_MonoSdksAndroidToolchainPrefix)&quot; LLVM_SRC=&quot;$(_MonoSdksLlvmSrc)&quot; MXE_PREFIX_DIR=&quot;$(_MonoSdksMxePrefixDir)&quot; MXE_SRC=&quot;$(_MonoSdksMxeSrc)&quot;</_MonoSdksParameters>
</PropertyGroup>
<PropertyGroup>
<_MonoArchivePrefix>android-$(_MonoSdksConfiguration)-$(HostOS)</_MonoArchivePrefix>
</PropertyGroup>
<PropertyGroup>
<ForceBuildDependsOn>
_DownloadArchive;
Expand All @@ -66,16 +70,8 @@
<_BclAssembly Include="@(MonoProfileAssembly)" />
<_BclExcludeDebugSymbols Include="System.Windows.dll" />
<_BclExcludeDebugSymbols Include="System.Xml.Serialization.dll" />
<_BclTestAssemblyDestination Include="@(MonoTestAssembly->'$(XAInstallPrefix)\..\..\bcl-tests\%(Identity)')" />
<_BclTestAssemblyDestination
Include="@(MonoTestAssembly->'$(XAInstallPrefix)\..\..\bcl-tests\%(Filename).pdb')"
Exclude="$(XAInstallPrefix)\..\..\bcl-tests\System.Runtime.CompilerServices.Unsafe.pdb"
/>
<_BclTestAssemblyDestination Include="@(MonoTestRunner->'$(XAInstallPrefix)\..\..\bcl-tests\%(Identity)')" />
<_BclTestAssemblyDestination Include="@(MonoTestRunner->'$(XAInstallPrefix)\..\..\bcl-tests\%(Filename).pdb')" />
</ItemGroup>
<ItemGroup>
<_BclTestOutput Include="@(_BclTestAssemblyDestination)" />
<_BclTestOutput Include="$(XAInstallPrefix)\..\..\bcl-tests\bcl-tests.zip" />
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -175,9 +171,6 @@
ToolExe="$(GitToolExe)" >
<Output TaskParameter="CommitHash" PropertyName="_MonoGitCommitHash" />
</GitCommitHash>
<PropertyGroup>
<_MonoArchiveName>android-$(_MonoSdksConfiguration)-$(_MonoGitCommitHash)-$(HostOS)</_MonoArchiveName>
</PropertyGroup>
</Target>

<Target Name="_GetRuntimesOutputItems">
Expand Down Expand Up @@ -257,13 +250,13 @@
Include="@(_MonoRuntime->'$(_MSBuildDir)\lib\%(Identity)\%(OutputMonoPosixHelperFilename).d.%(NativeLibraryExtension)')"
/>
<_RuntimeEglibHeaderSource
Include="@(_MonoRuntime->'$(MonoSourceFullPath)\sdks\builds\android-%(Identity)-$(_MonoSdksConfiguration)\mono\eglib\eglib-config.h')"
Include="@(_MonoRuntime->'$(MonoSourceFullPath)\sdks\out\android-%(Identity)-$(_MonoSdksConfiguration)\share\mono-2.0\mono\eglib\eglib-config.h')"
/>
<_RuntimeEglibHeaderOutput
Include="@(_MonoRuntime->'$(_OutputIncludeDir)%(Identity)\eglib\eglib-config.h')"
/>
<_MonoConstsSource
Include="$(MonoSourceFullPath)\mcs\build\common\Consts.cs"
Include="$(MonoSourceFullPath)\sdks\out\android-bcl\monodroid\Consts.cs"
/>
<_MonoConstsOutput
Include="$(_OutputIncludeDir)Consts.cs"
Expand All @@ -273,24 +266,27 @@

<Target Name="_DownloadArchive"
DependsOnTargets="_GetMonoGitCommitHash"
Condition=" !Exists('$(MonoSourceFullPath)\sdks\out\.stamp-$(_MonoArchiveName)-build') And !Exists('$(MonoSourceFullPath)\sdks\out\.stamp-$(_MonoArchiveName)-download') " >
Inputs="$(AndroidToolchainCacheDirectory)\$(_MonoArchivePrefix)-$(_MonoGitCommitHash).zip"
Outputs="$(MonoSourceFullPath)\sdks\out\.stamp-$(_MonoArchivePrefix)-$(_MonoGitCommitHash)-download"
Condition=" !Exists('$(MonoSourceFullPath)\sdks\out\.stamp-$(_MonoArchivePrefix)-$(_MonoGitCommitHash)-build') And '$(DisableDownloadArchive)' == '' " >
<MakeDir
Directories="$(MonoSourceFullPath)\sdks\out"
/>
<DownloadUri
SourceUris="https://xamjenkinsartifact.blob.core.windows.net/mono-sdks/$(_MonoArchiveName).tar.gz"
DestinationFiles="$(AndroidToolchainCacheDirectory)\$(_MonoArchiveName).tar.gz"
SourceUris="https://xamjenkinsartifact.azureedge.net/mono-sdks/$(_MonoArchivePrefix)-$(_MonoGitCommitHash).zip"
DestinationFiles="$(AndroidToolchainCacheDirectory)\$(_MonoArchivePrefix)-$(_MonoGitCommitHash).zip"
ContinueOnError="True"
/>
<Exec
Condition=" Exists('$(AndroidToolchainCacheDirectory)\$(_MonoArchiveName).tar.gz') "
Command="tar -xvf $(AndroidToolchainCacheDirectory)\$(_MonoArchiveName).tar.gz"
IgnoreStandardErrorWarningFormat="True"
WorkingDirectory="$(MonoSourceFullPath)\sdks\out"
<UnzipDirectoryChildren
Condition=" Exists('$(AndroidToolchainCacheDirectory)\$(_MonoArchivePrefix)-$(_MonoGitCommitHash).zip') "
HostOS="$(HostOS)"
SourceFiles="$(AndroidToolchainCacheDirectory)\$(_MonoArchivePrefix)-$(_MonoGitCommitHash).zip"
DestinationFolder="$(MonoSourceFullPath)\sdks\out"
NoSubdirectory="True"
/>
<Touch
Condition=" Exists('$(AndroidToolchainCacheDirectory)\$(_MonoArchiveName).tar.gz') "
Files="$(MonoSourceFullPath)\sdks\out\.stamp-$(_MonoArchiveName)-download"
Condition=" Exists('$(AndroidToolchainCacheDirectory)\$(_MonoArchivePrefix)-$(_MonoGitCommitHash).zip') "
Files="$(MonoSourceFullPath)\sdks\out\.stamp-$(_MonoArchivePrefix)-$(_MonoGitCommitHash)-download"
AlwaysCreate="True"
/>
</Target>
Expand All @@ -299,66 +295,37 @@
Condition=" '@(_MonoRuntime)' != '' Or '@(_MonoCrossRuntime)' != '' Or '@(_MonoBcl)' != '' Or '@(_LlvmRuntime)' != '' "
DependsOnTargets="_GetMonoGitCommitHash;_DownloadArchive">
<Exec
Condition=" !Exists('$(MonoSourceFullPath)\sdks\out\.stamp-$(_MonoArchiveName)-download') "
Condition=" !Exists('$(MonoSourceFullPath)\sdks\out\.stamp-$(_MonoArchivePrefix)-$(_MonoGitCommitHash)-download') "
Command="make DISABLE_IOS=1 $(MakeConcurrency) @(_MonoRuntime->'package-android-%(Identity)', ' ') @(_MonoCrossRuntime->'package-android-%(Identity)', ' ') @(_MonoBcl->'package-android-%(Identity)', ' ') @(_LlvmRuntime->'provision-llvm-%(Identity)', ' ') $(_MonoSdksParameters)"
IgnoreStandardErrorWarningFormat="True"
WorkingDirectory="$(MonoSourceFullPath)\sdks\builds"
/>
<Touch
Condition=" !Exists('$(MonoSourceFullPath)\sdks\out\.stamp-$(_MonoArchiveName)-download') "
Files="$(MonoSourceFullPath)\sdks\out\.stamp-$(_MonoArchiveName)-build"
Condition=" !Exists('$(MonoSourceFullPath)\sdks\out\.stamp-$(_MonoArchivePrefix)-$(_MonoGitCommitHash)-download') "
Files="$(MonoSourceFullPath)\sdks\out\.stamp-$(_MonoArchivePrefix)-$(_MonoGitCommitHash)-build"
AlwaysCreate="True"
/>
</Target>

<Target Name="_InstallRuntimes"
DependsOnTargets="_GetRuntimesOutputItems"
Inputs="@(_RuntimeSource);@(_RuntimeBinarySource);@(_CrossRuntimeBinarySource);@(_ProfilerSource);@(_MonoPosixHelperSource);@(_RuntimeEglibHeaderSource);@(_MonoBtlsSource)"
Outputs="@(_InstallRuntimeOutput);@(_InstallRuntimeBinaryOutput);@(_InstallCrossRuntimeBinaryOutput);@(_InstallProfilerOutput);@(_InstallMonoPosixHelperOutput);@(_RuntimeEglibHeaderOutput)">
Outputs="@(_InstallRuntimeOutput);@(_InstallRuntimeBinaryOutput);@(_InstallCrossRuntimeBinaryOutput);@(_InstallProfilerOutput);@(_InstallMonoPosixHelperOutput);@(_RuntimeEglibHeaderOutput);do-not-cache">
<ItemGroup>
<_BclTestAssemblyReference Include="@(MonoTestAssembly)" Condition="'%(MonoTestAssembly.TestType)' == 'reference'" />
<_BclTestAssembly Include="@(MonoTestAssembly)" Condition="'%(MonoTestAssembly.TestType)' == '' Or '%(MonoTestAssembly.TestType)' == 'xunit' " />
<_BclTestAssemblySource Include="@(_BclTestAssemblyReference->'$(_MonoProfileDir)\%(Identity)')" />
<_BclTestAssemblySource Include="@(_BclTestAssemblyReference->'$(_MonoProfileDir)\%(Filename).pdb')" Condition="Exists('@(_BclTestAssemblyReference->'$(_MonoProfileDir)\%(Filename).pdb')')" />
<_BclTestAssemblySource Include="@(_BclTestAssembly->'$(_MonoProfileDir)\tests\%(Identity)')" />
<_BclTestAssemblySource Include="@(_BclTestAssembly->'$(_MonoProfileDir)\tests\%(Filename).pdb')" />
<_BclTestAssemblySource Include="@(MonoTestRunner->'$(_MonoProfileDir)\%(Identity)')" />
<_BclTestAssemblySource Include="@(MonoTestRunner->'$(_MonoProfileDir)\%(Filename).pdb')" />
<_BclTest Include="$(_MonoProfileDir)\tests\**\*" />
<!-- This is referenced by monodroid_corlib_xunit-test.dll -->
<_BclTest Include="$(_MonoProfileDir)\System.Runtime.CompilerServices.Unsafe.dll" />
</ItemGroup>
<Copy
SourceFiles="@(_BclTestAssemblySource)"
DestinationFolder="$(XAInstallPrefix)\..\..\bcl-tests"
/>
<Touch
Files="@(_BclTestAssemblySource->'$(XAInstallPrefix)\..\..\bcl-tests\%(Filename)%(Extension)')"
/>
<ItemGroup>
<_BclTestContent Include="$(MonoSourceFullPath)\mcs\class\%(MonoTestAssembly.SourcePath)\Test\**\*.*" />
<_BclTestContent Remove="$(MonoSourceFullPath)\mcs\class\%(MonoTestAssembly.SourcePath)\Test\**\*.cs" />
<_BclTestContent Remove="$(MonoSourceFullPath)\mcs\class\%(MonoTestAssembly.SourcePath)\Test\**\.gitattributes" />
<_BclTestContentDest Include="@(_BclTestContent->'$(XAInstallPrefix)\..\..\bcl-tests\Test\%(RecursiveDir)%(Filename)%(Extension)')" />
</ItemGroup>
<ItemGroup>
<_ZipTestContent Include="$(MonoSourceFullPath)\mcs\class\System.IO.Compression.FileSystem\foo\**\*.*" />
<_ZipTestContentDest Include="@(_ZipTestContent->'$(XAInstallPrefix)\..\..\bcl-tests\foo\%(RecursiveDir)%(Filename)%(Extension)')" />
<_BclTestContent Include="@(_ZipTestContent)" />
<_BclTestContentDest Include="@(_ZipTestContentDest)" />
</ItemGroup>
<Copy
SourceFiles="@(_BclTestContent)"
DestinationFiles="@(_BclTestContentDest)"
/>
<Exec
Condition="!Exists('$(XAInstallPrefix)\..\..\bcl-tests\Test\test.db')"
Command="sqlite3 &quot;$(XAInstallPrefix)\..\..\bcl-tests\Test\test.db&quot; &lt; &quot;$(MonoSourceFullPath)\mcs\class\Mono.Data.Sqlite\Test\test.sql&quot;"
SourceFiles="@(_BclTest)"
DestinationFiles="@(_BclTest->'$(XAInstallPrefix)..\..\bcl-tests\%(RecursiveDir)%(Filename)%(Extension)')"
/>
<Touch Files="@(_BclTest->'$(XAInstallPrefix)..\..\bcl-tests\%(RecursiveDir)%(Filename)%(Extension)')" />
<Exec
Command="zip -r bcl-tests.zip ."
WorkingDirectory="$(XAInstallPrefix)\..\..\bcl-tests"
/>
<Touch
Files="$(XAInstallPrefix)\..\..\bcl-tests\bcl-tests.zip"
WorkingDirectory="$(XAInstallPrefix)..\..\bcl-tests"
/>
<Touch Files="$(XAInstallPrefix)..\..\bcl-tests\bcl-tests.zip" />

<MakeDir
Directories="$(_MSBuildDir)\lib\%(_MonoRuntime.Identity)"
Expand Down Expand Up @@ -615,8 +582,8 @@
/>

<ItemGroup>
<_StampFiles Include="$(MonoSourceFullPath)\sdks\out\.stamp-android-$(_MonoSdksConfiguration)-*-$(HostOS)-build"/>
<_StampFiles Include="$(MonoSourceFullPath)\sdks\out\.stamp-android-$(_MonoSdksConfiguration)-*-$(HostOS)-download"/>
<_StampFiles Include="$(MonoSourceFullPath)\sdks\out\.stamp-$(_MonoArchivePrefix)-*-build"/>
<_StampFiles Include="$(MonoSourceFullPath)\sdks\out\.stamp-$(_MonoArchivePrefix)-*-download"/>
</ItemGroup>
<Delete Files="@(_StampFiles)" />
</Target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public NUnitInstrumentation ()

void CommonInit ()
{
TestAssembliesGlobPattern = "*_test.dll";
string cacheDir = Path.Combine (Application.Context.CacheDir.AbsolutePath, DefaultLogTag);
using (var files = typeof (NUnitInstrumentation).Assembly.GetManifestResourceStream ("bcl-tests.zip")) {
ExtractAssemblies (cacheDir, files);
Expand Down Expand Up @@ -83,5 +82,17 @@ protected override IList<TestAssemblyInfo> GetTestAssemblies()

return ret;
}

protected override IEnumerable<TestAssemblyInfo> GetTestAssembliesFromDirectory (string directoryPath)
{
using (var reader = new StreamReader (typeof (NUnitInstrumentation).Assembly.GetManifestResourceStream ("nunit-assemblies.txt")))
{
string line;
while ((line = reader.ReadLine ()) != null)
{
yield return LoadTestAssembly (Path.Combine (directoryPath, line));
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Text;

using Android.App;
using Android.Runtime;

using Xamarin.Android.UnitTests;
using Xamarin.Android.UnitTests.XUnit;

namespace xUnitTestRunner
Expand Down Expand Up @@ -34,7 +35,6 @@ public XUnitInstrumentation ()

void CommonInit ()
{
TestAssembliesGlobPattern = "*_xunit-test.dll";
string cacheDir = Path.Combine (Application.Context.CacheDir.AbsolutePath, DefaultLogTag);
using (var files = typeof (XUnitInstrumentation).Assembly.GetManifestResourceStream ("bcl-tests.zip")) {
ExtractAssemblies (cacheDir, files);
Expand Down Expand Up @@ -79,5 +79,17 @@ protected override void ConfigureFilters (XUnitTestRunner runner)

runner.SetFilters (filters);
}

protected override IEnumerable<TestAssemblyInfo> GetTestAssembliesFromDirectory (string directoryPath)
{
using (var reader = new StreamReader (typeof (XUnitInstrumentation).Assembly.GetManifestResourceStream ("xunit-assemblies.txt")))
{
string line;
while ((line = reader.ReadLine ()) != null)
{
yield return LoadTestAssembly (Path.Combine (directoryPath, line));
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@
<None Include="Properties\AndroidManifest.xml" />
<None Include="Assets\AboutAssets.txt" />
<None Include="packages.config" />
<EmbeddedResource Include="xunit-assemblies.txt">
<LogicalName>xunit-assemblies.txt</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="nunit-assemblies.txt">
<LogicalName>nunit-assemblies.txt</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="xunit-excluded-tests.txt">
<LogicalName>xunit-excluded-tests.txt</LogicalName>
</EmbeddedResource>
Expand Down
Loading