コード例 #1
0
        public void TestExtract()
        {
            Logger        = new TestLogger();
            LogsDirectory = TestContext.TestLogsDir;
            LogFileName   = $"{TestContext.TestName}.txt";

            string currentDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            //TODO: Need to fix paths

            string solutionPackager = $"{currentDirectory}\\..\\..\\..\\packages\\Microsoft.CrmSdk.CoreTools.9.0.2.6\\content\\bin\\coretools\\SolutionPackager.exe";

            string extractDir = LogsDirectory + "Customizations";

            Directory.CreateDirectory(extractDir);

            SolutionPackager packager = new SolutionPackager(
                Logger,
                solutionPackager,
                currentDirectory + "\\..\\..\\Artifacts\\Success_1_0_0_0.zip",
                extractDir,
                LogsDirectory + "\\" + LogFileName);

            bool success = packager.Extract(
                SolutionPackager_PackageType.Both,
                string.Empty,
                true,
                true,
                true,
                string.Empty,
                false);

            Assert.AreEqual(success, true);
        }
コード例 #2
0
        public void TestPackSolution()
        {
            Logger        = new TestLogger();
            LogsDirectory = TestContext.TestLogsDir;
            LogFileName   = $"{TestContext.TestName}.txt";

            string currentDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            //TODO: Need to fix paths

            string solutionPackager = $"{currentDirectory}\\..\\..\\..\\packages\\Microsoft.CrmSdk.CoreTools.9.0.2.11\\content\\bin\\coretools\\SolutionPackager.exe";

            string folder = @"C:\Dev\Src\dyn365-ce-devops-sample\Sample\Xrm.CI.Framework.Sample\Customizations\Solutions\xRMCISample\Customizations";

            string mapping = @"C:\Dev\Src\dyn365-ce-devops-sample\Sample\Xrm.CI.Framework.Sample\Customizations\Solutions\xRMCISample\mapping.xml";

            SolutionPackager packager = new SolutionPackager(
                Logger,
                solutionPackager,
                LogsDirectory + "\\zzz.zip",
                folder,
                LogsDirectory + "\\" + LogFileName);

            bool success = packager.Pack(SolutionPackager_PackageType.Both, mapping, false);

            Assert.AreEqual(success, true);
        }
コード例 #3
0
 public SolutionPackagerTask(CrmServiceClient crmServiceClient, string currentDirectory, SolutionPackager solutionPackagerJson, string version)
 {
     if (solutionPackagerJson.rootfolder != null)
     {
         currentDirectory = currentDirectory + "\\" + solutionPackagerJson.rootfolder;
     }
     CrmServiceClient     = crmServiceClient;
     CurrentDirectory     = currentDirectory;
     SolutionPackagerJson = solutionPackagerJson;
     Version = version;
     if (!Directory.Exists(Path.Combine(CurrentDirectory, SolutionPackagerJson.solutionzipfolder)))
     {
         Directory.CreateDirectory(Path.Combine(CurrentDirectory, SolutionPackagerJson.solutionzipfolder));
     }
     if (!Directory.Exists(Path.Combine(CurrentDirectory, SolutionPackagerJson.folder)))
     {
         Directory.CreateDirectory(Path.Combine(CurrentDirectory, SolutionPackagerJson.folder));
     }
     if (SolutionPackagerJson.logfolder != null)
     {
         if (!Directory.Exists(Path.Combine(CurrentDirectory, SolutionPackagerJson.folder, SolutionPackagerJson.logfolder)))
         {
             Directory.CreateDirectory(Path.Combine(CurrentDirectory, SolutionPackagerJson.folder, SolutionPackagerJson.logfolder));
         }
     }
 }