DeployFile GeneratePcFile(DeployContext ctx, DotNetProject netProject, LinuxDeployData data, DotNetProjectConfiguration conf)
        {
            string libs     = "-r:@ProgramFiles@/" + Path.GetFileName(conf.CompiledOutputName);
            string requires = "";
            string version  = netProject.Version;

            if (string.IsNullOrEmpty(version) && netProject.ParentSolution != null)
            {
                version = netProject.ParentSolution.Version;
            }

            string file = ctx.CreateTempFile();

            using (StreamWriter sw = new StreamWriter(file))
            {
                sw.WriteLine("Name: " + netProject.Name);
                sw.WriteLine("Description: " + (String.IsNullOrEmpty(netProject.Description) ? netProject.Name : netProject.Description));
                sw.WriteLine("Version: " + version);
                sw.WriteLine();
                sw.WriteLine("Requires: " + requires);
                sw.WriteLine("Libs: " + libs);
            }
            string     outfile = netProject.Name.ToLower() + ".pc";
            DeployFile df      = new DeployFile(netProject, file, outfile, LinuxTargetDirectory.PkgConfig);

            df.ContainsPathReferences = true;
            df.DisplayName            = GettextCatalog.GetString("pkg-config file for {0}", netProject.Name);
            return(df);
        }
示例#2
0
        DeployFile GenerateLaunchScript(DeployContext ctx, DotNetProject netProject, LinuxDeployData data, DotNetProjectConfiguration conf)
        {
            string file = ctx.CreateTempFile();
            string exe  = "@ProgramFiles@/" + Path.GetFileName(conf.CompiledOutputName);

            using (StreamWriter sw = new StreamWriter(file)) {
                sw.WriteLine("#!/bin/sh");
                sw.WriteLine();
                sw.WriteLine("exec mono \"" + exe + "\" \"$@\"");
            }
            string outfile = data.ScriptName;

            if (string.IsNullOrEmpty(outfile))
            {
                outfile = netProject.Name.ToLower();
            }
            DeployFile df = new DeployFile(netProject, file, outfile, TargetDirectory.Binaries);

            df.ContainsPathReferences = true;
            df.DisplayName            = GettextCatalog.GetString("Launch script for {0}", netProject.Name);
            df.FileAttributes         = DeployFileAttributes.Executable;
            return(df);
        }