Esempio n. 1
0
        protected async Task <IPackage> CreatePackage(PackageDescriptor descriptor, PackageTool tool)
        {
            await tool.Prepare();

            try
            {
                var projectAsset = await tool.LocateProjectAsset();

                var package = new Package2(descriptor.Name, tool.DirectoryAccessor);
                package.Add(projectAsset);
                try
                {
                    var wasmAsset = await tool.LocateWasmAsset();

                    package.Add(wasmAsset);
                }
                catch (WasmAssetNotFoundException)
                {
                }

                return(package);
            }
            catch (ProjectAssetNotFoundException)
            {
                return(null);
            }
        }
Esempio n. 2
0
        protected async Task <IPackage> CreatePackage(PackageDescriptor descriptor, PackageTool tool)
        {
            await tool.Prepare();

            var projectAsset = await tool.LocateProjectAsset();

            if (projectAsset != null)
            {
                var package = new Package2(descriptor.Name, tool.DirectoryAccessor);
                package.Add(projectAsset);

                var wasmAsset = await tool.LocateWasmAsset();

                if (wasmAsset != null)
                {
                    package.Add(wasmAsset);
                    return(package);
                }
            }

            return(null);
        }
Esempio n. 3
0
        protected async Task <IPackage> CreatePackage(PackageDescriptor descriptor, PackageTool tool)
        {
            await tool.Prepare();

            var wasmAsset = await tool.LocateWasmAsset();

            if (wasmAsset != null)
            {
                var package = new Package2(descriptor.Name, new FileSystemDirectoryAccessor(wasmAsset.DirectoryAccessor.GetFullyQualifiedRoot().Parent));
                package.Add(wasmAsset);
                return(package);
            }

            return(null);
        }