Esempio n. 1
0
static int writeWorkspace()
{
	int i;

	if (!io_openfile(path_join(prj_get_path(), prj_get_name(), "dsw")))
		return 0;

	io_print("Microsoft Developer Studio Workspace File, Format Version 6.00\n");
	io_print("# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!\n");
	io_print("\n");
	io_print("###############################################################################\n");
	io_print("\n");

	for (i = 0; i < prj_get_numpackages(); ++i)
	{
		prj_select_package(i);

		io_print("Project: \"%s\"=%s - Package Owner=<4>\n", prj_get_pkgname(), prj_get_pkgfilename("dsp"));
		io_print("\n");
		io_print("Package=<5>\n");
		io_print("{{{\n");
		io_print("}}}\n");
		io_print("\n");
		io_print("Package=<4>\n");
		io_print("{{{\n");

		/* Write package dependencies */
		prj_select_config(0);
		print_list(prj_get_links(), "", "", "", listPackageDeps);

		io_print("}}}\n");
		io_print("\n");
		io_print("###############################################################################\n");
		io_print("\n");
	}

	io_print("Global:\n");
	io_print("\n");
	io_print("Package=<5>\n");
	io_print("{{{\n");
	io_print("}}}\n");
	io_print("\n");
	io_print("Package=<3>\n");
	io_print("{{{\n");
	io_print("}}}\n");
	io_print("\n");
	io_print("###############################################################################\n");
	io_print("\n");

	io_closefile();
	return 1;
}
Esempio n. 2
0
static int writeCombine()
{
	const char* path;
	int i, j;

	if (!io_openfile(path_join(prj_get_path(), prj_get_name(), "cmbx")))
		return 0;

	io_print("<Combine fileversion=\"1.0\" name=\"%s\" description=\"\">\n", prj_get_name());

	/* TODO: select the first executable project */
	io_print("  <StartMode startupentry=\"\" single=\"True\">\n");

	/* Write out the startup entries */
	for (i = 0; i < prj_get_numpackages(); ++i)
	{
		prj_select_package(i);
		io_print("    <Execute entry=\"%s\" type=\"None\" />\n", prj_get_pkgname());
	}

	io_print("  </StartMode>\n");
	io_print("  <Entries>\n");

	/* Write out the project entries */
	for (i = 0; i < prj_get_numpackages(); ++i)
	{
		prj_select_package(i);
		path = prj_get_pkgfilename("prjx");
		io_print("    <Entry filename=\"");
		if (path[0] != '.')
			io_print("./");
		io_print("%s\" />\n", path);
	}

	io_print("  </Entries>\n");
	io_print("  <Configurations active=\"Debug\">\n");

	/* Write out the entries for each build configuration */
	for (i = 0; i < prj_get_numconfigs(); ++i)
	{
		prj_select_config(i);
		io_print("    <Configuration name=\"%s\">\n", xmlEscape(prj_get_cfgname()));

		/* List all packages under this configuration */
		prj_select_config(0);
		for(j = 0; j < prj_get_numpackages(); j++)
		{
			prj_select_package(j);
			io_print("      <Entry name=\"%s\" configurationname=\"%s\" build=\"False\" />\n", prj_get_pkgname(), xmlEscape(prj_get_cfgname()));
		}

		io_print("    </Configuration>\n");
	}

	/* Finish */
	io_print("  </Configurations>\n");
	io_print("</Combine>");
	io_closefile();

	/* MonoDevelop adds another file */
	if (sharpdev_target == MONODEV)
	{
		if (!io_openfile(path_join(prj_get_path(), prj_get_name(), "mdsx")))
			return 0;

		prj_select_config(0);
		io_print("<MonoDevelopSolution fileversion=\"1.0\">\n");
		io_print("  <RelativeOutputPath>%s</RelativeOutputPath>\n", prj_get_bindir());
		io_print("</MonoDevelopSolution>\n");

		io_closefile();
	}

	return 1;
}
Esempio n. 3
0
static int vs2002_write_solution()
{
    VsPkgData* data;
    int i, j;

    if (!io_openfile(path_join(prj_get_path(), prj_get_name(), "sln")))
        return 0;

    /* Format identification string */
    io_print("Microsoft Visual Studio Solution File, Format Version ");
    if (vs_getversion() == VS2002)
        io_print("7.00\n");
    else
        io_print("8.00\n");

    /* List packages */
    for (i = 0; i < prj_get_numpackages(); ++i)
    {
        prj_select_package(i);
        data = (VsPkgData*)prj_get_data();

        io_print("Project(\"{%s}\") = \"%s\", \"%s\", \"{%s}\"\n", data->toolGuid, prj_get_pkgname(), prj_get_pkgfilename(data->projExt), data->projGuid);

        /* Write package dependencies for post-2002 */
        if (vs_getversion() > VS2002)
        {
            prj_select_config(0);
            io_print("\tProjectSection(ProjectDependencies) = postProject\n");
            print_list(prj_get_links(), "\t\t", "\n", "", vs_list_pkgdeps);
            io_print("\tEndProjectSection\n");
        }

        io_print("EndProject\n");
    }

    /* List configurations */
    io_print("Global\n");
    io_print("\tGlobalSection(SolutionConfiguration) = preSolution\n");

    prj_select_package(0);
    for (i = 0; i < prj_get_numconfigs(); ++i)
    {
        prj_select_config(i);
        if (vs_getversion() == VS2002)
            io_print("\t\tConfigName.%d = %s\n", i, prj_get_cfgname());
        else
            io_print("\t\t%s = %s\n", prj_get_cfgname(), prj_get_cfgname());
    }
    io_print("\tEndGlobalSection\n");

    /* Write package dependencies for 2002 */
    if (vs_getversion() == VS2002)
    {
        io_print("\tGlobalSection(ProjectDependencies) = postSolution\n");
        for (i = 0; i < prj_get_numpackages(); ++i)
        {
            prj_select_package(i);
            prj_select_config(0);
            print_list(prj_get_links(), "\t\t", "\n", "", vs_list_pkgdeps);
        }
        io_print("\tEndGlobalSection\n");
    }

    /* Write configuration for each package */
    io_print("\tGlobalSection(ProjectConfiguration) = postSolution\n");

    for (i = 0; i < prj_get_numpackages(); ++i)
    {
        prj_select_package(i);
        for (j = 0; j < prj_get_numconfigs(); ++j)
        {
            prj_select_config(j);
            data = (VsPkgData*)prj_get_data();

            /* I may actually be writing the wrong thing for VS2002-2003, but has
             * seemed to work for this long so I am going to leave it alone */
            io_print("\t\t{%s}.%s.ActiveCfg = %s|%s\n", data->projGuid, prj_get_cfgname(), prj_get_cfgname(), data->projType);
            io_print("\t\t{%s}.%s.Build.0 = %s|%s\n", data->projGuid, prj_get_cfgname(), prj_get_cfgname(), data->projType);
        }
    }
    io_print("\tEndGlobalSection\n");

    /* Finish */
    io_print("\tGlobalSection(ExtensibilityGlobals) = postSolution\n");
    io_print("\tEndGlobalSection\n");
    io_print("\tGlobalSection(ExtensibilityAddIns) = postSolution\n");
    io_print("\tEndGlobalSection\n");
    io_print("EndGlobal\n");

    io_closefile();
    return 1;
}
Esempio n. 4
0
static int vs2005_write_solution(int target)
{
	VsPkgData* data;
	int hasDotNet, hasCpp;
	int i, j;
	int numAspNet, port;

	if (!io_openfile(path_join(prj_get_path(), prj_get_name(), "sln")))
		return 0;

	/* Format identification string */
	if (target == 2005)
	{
		io_print("Microsoft Visual Studio Solution File, Format Version 9.00\n");
		io_print("# Visual Studio 2005\n");
	}
	else
	{
		io_print("Microsoft Visual Studio Solution File, Format Version 10.00\n");
		io_print("# Visual Studio 2008\n");
	}

	/* List packages */
	numAspNet = 0;
	for (i = 0; i < prj_get_numpackages(); ++i)
	{
		prj_select_package(i);
		prj_select_config(0);

		data = (VsPkgData*)prj_get_data();

		if (prj_is_kind("aspnet"))
		{
			const char* path = prj_get_pkgpath();
			if (strlen(path) == 0) path = ".";

			io_print("Project(\"{%s}\") = \"%s\", \"%s\\\", \"{%s}\"\n", data->toolGuid, prj_get_pkgname(), path, data->projGuid);
			io_print("\tProjectSection(WebsiteProperties) = preProject\n");

			if (prj_get_numlinks() > 0)
				print_list(prj_get_links(), "\t\tProjectReferences = \"", ";\"\n", ";", list_aspnet_refs);

			for (j = 0; j < prj_get_numconfigs(); ++j)
			{
				prj_select_config(j);
				io_print("\t\t%s.AspNetCompiler.VirtualPath = \"/%s\"\n", prj_get_cfgname(), prj_get_pkgname());
				io_print("\t\t%s.AspNetCompiler.PhysicalPath = \"%s\\\"\n", prj_get_cfgname(), path);
				io_print("\t\t%s.AspNetCompiler.TargetPath = \"PrecompiledWeb\\%s\\\"\n", prj_get_cfgname(), prj_get_pkgname());
				io_print("\t\t%s.AspNetCompiler.Updateable = \"true\"\n", prj_get_cfgname());
				io_print("\t\t%s.AspNetCompiler.ForceOverwrite = \"true\"\n", prj_get_cfgname());
				io_print("\t\t%s.AspNetCompiler.FixedNames = \"false\"\n", prj_get_cfgname());
				io_print("\t\t%s.AspNetCompiler.Debug = \"%s\"\n", prj_get_cfgname(), prj_has_flag("no-symbols") ? "False" : "True");
			}

			if (numAspNet == 0)
				port = 1106;
			else if (numAspNet == 1)
				port = 1231;
			else
				port = 1251 + 2 * (numAspNet - 2);
			io_print("\t\tVWDPort = \"%d\"\n", port);
			numAspNet++;

			if (prj_is_lang("c#"))
				io_print("\t\tDefaultWebSiteLanguage = \"Visual C#\"\n");

			io_print("\tEndProjectSection\n");
		}
		else
		{
			io_print("Project(\"{%s}\") = \"%s\", \"%s\", \"{%s}\"\n", data->toolGuid, prj_get_pkgname(), prj_get_pkgfilename(data->projExt), data->projGuid);
	
			/* Write dependencies */
			prj_select_config(0);
			io_print("\tProjectSection(ProjectDependencies) = postProject\n");
			print_list(prj_get_links(), "\t\t", "\n", "", vs_list_pkgdeps);
			io_print("\tEndProjectSection\n");
		}

		io_print("EndProject\n");
	}

	/* List configurations */
	io_print("Global\n");
	io_print("\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n");

	hasDotNet = 0;
	hasCpp = 0;
	for (i = 0; i < prj_get_numpackages(); ++i)
	{
		prj_select_package(i);
		if (prj_is_lang("c") || prj_is_lang("c++"))
			hasCpp = 1;
		else
			hasDotNet = 1;
	}

	prj_select_package(0);
	for (i = 0; i < prj_get_numconfigs(); ++i)
	{
		prj_select_config(i);
		if (hasDotNet)
			io_print("\t\t%s|Any CPU = %s|Any CPU\n", prj_get_cfgname(), prj_get_cfgname());
		if (hasDotNet && hasCpp)
			io_print("\t\t%s|Mixed Platforms = %s|Mixed Platforms\n", prj_get_cfgname(), prj_get_cfgname());
		if (hasCpp)
			io_print("\t\t%s|Win32 = %s|Win32\n", prj_get_cfgname(), prj_get_cfgname());
	}
	io_print("\tEndGlobalSection\n");

	/* Write configuration for each package */
	io_print("\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n");
	for (i = 0; i < prj_get_numpackages(); ++i)
	{
		prj_select_package(i);
		for (j = 0; j < prj_get_numconfigs(); ++j)
		{
			const char* arch;

			prj_select_config(j);
			data = (VsPkgData*)prj_get_data();

			if (prj_is_lang("c") || prj_is_lang("c++"))
				arch = "Win32";
			else
				arch = "Any CPU";

			if (hasDotNet)	
			{
				io_print("\t\t{%s}.%s|Any CPU.ActiveCfg = %s|%s\n", data->projGuid, prj_get_cfgname(), prj_get_cfgname(), arch);
				if (!prj_is_lang("c") && !prj_is_lang("c++"))
					io_print("\t\t{%s}.%s|Any CPU.Build.0 = %s|%s\n", data->projGuid, prj_get_cfgname(), prj_get_cfgname(), arch);
			}

			if (hasDotNet && hasCpp)	
			{
				io_print("\t\t{%s}.%s|Mixed Platforms.ActiveCfg = %s|%s\n", data->projGuid, prj_get_cfgname(), prj_get_cfgname(), arch);
				io_print("\t\t{%s}.%s|Mixed Platforms.Build.0 = %s|%s\n", data->projGuid, prj_get_cfgname(), prj_get_cfgname(), arch);
			}

			if (hasCpp)	
			{
				io_print("\t\t{%s}.%s|Win32.ActiveCfg = %s|%s\n", data->projGuid, prj_get_cfgname(), prj_get_cfgname(), arch);
				if (prj_is_lang("c") || prj_is_lang("c++"))
					io_print("\t\t{%s}.%s|Win32.Build.0 = %s|%s\n", data->projGuid, prj_get_cfgname(), prj_get_cfgname(), arch);
			}
		}
	}
	io_print("\tEndGlobalSection\n");

	/* Finish */
	io_print("\tGlobalSection(SolutionProperties) = preSolution\n");
	io_print("\t\tHideSolutionNode = FALSE\n");
	io_print("\tEndGlobalSection\n");
	io_print("EndGlobal\n");

	io_closefile();
	return 1;
}