Esempio n. 1
0
    public override bool Execute()
    {
        Utils.Logger = Log;

        string abi = DetermineAbi();

        var apkBuilder = new ApkBuilder();

        apkBuilder.ProjectName         = ProjectName;
        apkBuilder.AppDir              = AppDir;
        apkBuilder.OutputDir           = OutputDir;
        apkBuilder.AndroidSdk          = AndroidSdk;
        apkBuilder.AndroidNdk          = AndroidNdk;
        apkBuilder.MinApiLevel         = MinApiLevel;
        apkBuilder.BuildApiLevel       = BuildApiLevel;
        apkBuilder.BuildToolsVersion   = BuildToolsVersion;
        apkBuilder.StripDebugSymbols   = StripDebugSymbols;
        apkBuilder.NativeMainSource    = NativeMainSource;
        apkBuilder.KeyStorePath        = KeyStorePath;
        apkBuilder.ForceInterpreter    = ForceInterpreter;
        apkBuilder.ForceAOT            = ForceAOT;
        apkBuilder.StaticLinkedRuntime = StaticLinkedRuntime;
        apkBuilder.RuntimeComponents   = RuntimeComponents;
        apkBuilder.Assemblies          = Assemblies;
        (ApkBundlePath, ApkPackageId)  = apkBuilder.BuildApk(abi, MainLibraryFileName, MonoRuntimeHeaders);

        return(true);
    }
Esempio n. 2
0
    public override bool Execute()
    {
        string abi = DetermineAbi();

        var apkBuilder = new ApkBuilder(Log);

        apkBuilder.ProjectName                  = ProjectName;
        apkBuilder.AppDir                       = AppDir;
        apkBuilder.OutputDir                    = OutputDir;
        apkBuilder.AndroidSdk                   = AndroidSdk;
        apkBuilder.AndroidNdk                   = AndroidNdk;
        apkBuilder.MinApiLevel                  = MinApiLevel;
        apkBuilder.BuildApiLevel                = BuildApiLevel;
        apkBuilder.BuildToolsVersion            = BuildToolsVersion;
        apkBuilder.StripDebugSymbols            = StripDebugSymbols;
        apkBuilder.NativeMainSource             = NativeMainSource;
        apkBuilder.IncludeNetworkSecurityConfig = IncludeNetworkSecurityConfig;
        apkBuilder.KeyStorePath                 = KeyStorePath;
        apkBuilder.ForceInterpreter             = ForceInterpreter;
        apkBuilder.ForceAOT                     = ForceAOT;
        apkBuilder.ForceFullAOT                 = ForceFullAOT;
        apkBuilder.EnvironmentVariables         = EnvironmentVariables;
        apkBuilder.StaticLinkedRuntime          = StaticLinkedRuntime;
        apkBuilder.RuntimeComponents            = RuntimeComponents;
        apkBuilder.DiagnosticPorts              = DiagnosticPorts;
        apkBuilder.Assemblies                   = Assemblies;
        (ApkBundlePath, ApkPackageId)           = apkBuilder.BuildApk(abi, MainLibraryFileName, MonoRuntimeHeaders);

        return(true);
    }
Esempio n. 3
0
    public override bool Execute()
    {
        var apkBuilder = new ApkBuilder(Log);

        apkBuilder.AndroidSdk        = AndroidSdk;
        apkBuilder.MinApiLevel       = MinApiLevel;
        apkBuilder.BuildToolsVersion = BuildToolsVersion;
        apkBuilder.KeyStorePath      = KeyStorePath;

        string testExclusionList = string.Join(
            '\n',
            (ExcludedTests ?? Enumerable.Empty <ITaskItem>()).Select(t => t.ItemSpec));

        foreach (ITaskItem apk in ApkPaths ?? Enumerable.Empty <ITaskItem>())
        {
            string apkPath = apk.GetMetadata("FullPath") !;
            apkBuilder.OutputDir = Path.GetDirectoryName(apkPath) !;
            using (ZipArchive apkArchive = ZipFile.Open(apkPath, ZipArchiveMode.Update))
            {
                ZipArchiveEntry assetsZipEntry = apkArchive.GetEntry("assets/assets.zip") !;
                using ZipArchive assetsArchive = new ZipArchive(assetsZipEntry.Open(), ZipArchiveMode.Update);
                ZipArchiveEntry testExclusionListEntry = assetsArchive.GetEntry("TestExclusionList.txt") !;
                using StreamWriter textExclusionListWriter = new StreamWriter(testExclusionListEntry.Open());
                textExclusionListWriter.WriteLine(testExclusionList);
            }
            apkBuilder.ZipAndSignApk(apkPath);
        }
        return(true);
    }
Esempio n. 4
0
    public override bool Execute()
    {
        var apkBuilder = new ApkBuilder(Log);

        apkBuilder.OutputDir         = OutputDir;
        apkBuilder.AndroidSdk        = AndroidSdk;
        apkBuilder.MinApiLevel       = MinApiLevel;
        apkBuilder.BuildToolsVersion = BuildToolsVersion;
        apkBuilder.KeyStorePath      = KeyStorePath;
        apkBuilder.ReplaceFileInApk(FilePath);
        return(true);
    }
Esempio n. 5
0
    public override bool Execute()
    {
        Utils.Logger = Log;

        var apkBuilder = new ApkBuilder();
        apkBuilder.ProjectName = ProjectName;
        apkBuilder.OutputDir = OutputDir;
        apkBuilder.AndroidSdk = AndroidSdk;
        apkBuilder.AndroidNdk = AndroidNdk;
        apkBuilder.MinApiLevel = MinApiLevel;
        apkBuilder.BuildApiLevel = BuildApiLevel;
        apkBuilder.BuildToolsVersion = BuildToolsVersion;
        (ApkBundlePath, ApkPackageId) = apkBuilder.BuildApk(SourceDir, Abi, MainLibraryFileName, MonoRuntimeHeaders);
        
        return true;
    }
Esempio n. 6
0
    public override bool Execute()
    {
        Utils.Logger = Log;

        var apkBuilder = new ApkBuilder();

        apkBuilder.ProjectName         = ProjectName;
        apkBuilder.OutputDir           = OutputDir;
        apkBuilder.AndroidSdk          = AndroidSdk;
        apkBuilder.AndroidNdk          = AndroidNdk;
        apkBuilder.MinApiLevel         = MinApiLevel;
        apkBuilder.BuildApiLevel       = BuildApiLevel;
        apkBuilder.BuildToolsVersion   = BuildToolsVersion;
        apkBuilder.StripDebugSymbols   = StripDebugSymbols;
        apkBuilder.AssemblySearchPaths = AssemblySearchPaths?.Select(a => a.ItemSpec)?.ToArray();
        apkBuilder.ExtraAssemblies     = ExtraAssemblies?.Select(a => a.ItemSpec)?.ToArray();
        (ApkBundlePath, ApkPackageId)  = apkBuilder.BuildApk(SourceDir, Abi, MainLibraryFileName, MonoRuntimeHeaders);

        return(true);
    }
Esempio n. 7
0
    public override bool Execute()
    {
        Utils.Logger = Log;

        string abi = DetermineAbi();

        var apkBuilder = new ApkBuilder();

        apkBuilder.ProjectName        = ProjectName;
        apkBuilder.OutputDir          = OutputDir;
        apkBuilder.AndroidSdk         = AndroidSdk;
        apkBuilder.AndroidNdk         = AndroidNdk;
        apkBuilder.MinApiLevel        = MinApiLevel;
        apkBuilder.BuildApiLevel      = BuildApiLevel;
        apkBuilder.BuildToolsVersion  = BuildToolsVersion;
        apkBuilder.StripDebugSymbols  = StripDebugSymbols;
        (ApkBundlePath, ApkPackageId) = apkBuilder.BuildApk(SourceDir, abi, MainLibraryFileName, MonoRuntimeHeaders);

        return(true);
    }