StringFromMinOSVersion() public static method

public static StringFromMinOSVersion ( ) : string
return string
Ejemplo n.º 1
0
        private static void CreateProject(string stagingArea)
        {
            Directory.CreateDirectory(Path.Combine(stagingArea, "build"));
            string     str    = TizenUtilities.StringFromMinOSVersion();
            TextWriter writer = new StreamWriter(Path.Combine(stagingArea, ".cproject"));

            writer.WriteLine("<cproject>");
            writer.WriteLine("<configuration name=\"build\">");
            writer.WriteLine("<app>");
            writer.WriteLine("<option superClass=\"sbi.gnu.cpp.compiler.option\">");
            writer.WriteLine("<listOptionValue value=\"mobile-" + str + "-device.core_gcc46.armel.core.app\"/>");
            writer.WriteLine("</option>");
            writer.WriteLine("</app>");
            writer.WriteLine("</configuration>");
            writer.WriteLine("</cproject>");
            writer.Close();
            TextWriter writer2 = new StreamWriter(Path.Combine(stagingArea, ".project"));

            writer2.WriteLine("<projectDescription>");
            writer2.WriteLine("<name>StagingArea</name>");
            writer2.WriteLine("</projectDescription>");
            writer2.Close();
            TextWriter writer3 = new StreamWriter(Path.Combine(stagingArea, "project_def.prop"));

            writer3.WriteLine("APPNAME = $(appName)");
            writer3.WriteLine("type = app");
            writer3.WriteLine("profile = $(platform)");
            writer3.WriteLine("USER_SRCS = ");
            writer3.WriteLine("USER_DEFS = ");
            writer3.WriteLine("USER_INC_DIRS = ");
            writer3.WriteLine("USER_OBJS = ");
            writer3.WriteLine("USER_LIBS = ");
            writer3.WriteLine("USER_EDCS = ");
            writer3.Close();
            TextWriter writer4 = new StreamWriter(Path.Combine(stagingArea, Path.Combine("build", "build.info")));

            writer4.WriteLine("toolchain=mobile-" + str + "-device.core");
            writer4.WriteLine("architecture=arm");
            writer4.WriteLine("profile-version=" + str);
            writer4.WriteLine("type=mobile");
            writer4.Close();
        }
Ejemplo n.º 2
0
        private static void CreateManifest(string manifestPath, string companyName, string productName, string normalizedProductName, string id, AssemblyReferenceChecker checker)
        {
            string     validVersionString = GetValidVersionString();
            TextWriter writer             = new StreamWriter(manifestPath);

            writer.WriteLine("<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>");
            writer.WriteLine("<manifest xmlns=\"http://tizen.org/ns/packages\" api-version=\"" + TizenUtilities.StringFromMinOSVersion() + "\" package=\"" + id + "\" version=\"" + validVersionString + "\">");
            writer.WriteLine("    <author href=\"" + PlayerSettings.Tizen.productURL + "\">" + companyName + "</author>");
            writer.WriteLine("   <profile name=\"mobile\" />");
            writer.WriteLine("\t<description>" + SecurityElement.Escape(PlayerSettings.Tizen.productDescription) + "</description>");
            writer.WriteLine("\t<ui-application appid=\"" + id + "\" exec=\"" + normalizedProductName + "\" type=\"capp\" multiple=\"false\" taskmanage=\"true\" nodisplay=\"false\">");
            writer.WriteLine("\t\t<icon>app_icon.png</icon>");
            writer.WriteLine("\t\t<label>" + productName + "</label>");
            writer.WriteLine("\t</ui-application>");
            writer.WriteLine("\t<feature name=\"http://tizen.org/feature/screen.size.all\">true</feature>");
            writer.WriteLine("\t<privileges>");
            if (checker.HasReferenceToMethod("UnityEngine.Handheld::Vibrate") || checker.HasReferenceToMethod("UnityEngine.iPhoneUtils::Vibrate"))
            {
                writer.WriteLine("\t\t<privilege>http://tizen.org/privilege/haptic</privilege>");
            }
            if (checker.HasReferenceToType("UnityEngine.WebCamTexture"))
            {
                writer.WriteLine("\t\t<privilege>http://tizen.org/privilege/camera</privilege>");
            }
            if (checker.HasReferenceToMethod("UnityEngine.Application::OpenURL") || checker.HasReferenceToType("UnityEngine.Purchasing"))
            {
                writer.WriteLine("\t\t<privilege>http://tizen.org/privilege/appmanager.launch</privilege>");
            }
            if (checker.HasReferenceToMethod("UnityEngine.Screen::set_sleepTimeout"))
            {
                writer.WriteLine("\t\t<privilege>http://tizen.org/privilege/display</privilege>");
            }
            if (((checker.HasReferenceToType("UnityEngine.Networking") || checker.HasReferenceToType("System.Net.Sockets")) || (checker.HasReferenceToType("UnityEngine.Network") || checker.HasReferenceToType("UnityEngine.RPC"))) || (((checker.HasReferenceToType("UnityEngine.WWW") || checker.HasReferenceToType("UnityEngine.Video")) || (checker.HasReferenceToType(typeof(Ping).FullName) || checker.HasReferenceToType(typeof(UnityWebRequest).FullName))) || (EditorUserBuildSettings.allowDebugging || EditorUserBuildSettings.connectProfiler)))
            {
                writer.WriteLine("\t\t<privilege>http://tizen.org/privilege/internet</privilege>");
            }
            if (checker.HasReferenceToType("UnityEngine.Video"))
            {
                writer.WriteLine("\t\t<privilege>http://tizen.org/privilege/mediastorage</privilege>");
            }
            if (checker.HasReferenceToType("UnityEngine.Video"))
            {
                writer.WriteLine("\t\t<privilege>http://tizen.org/privilege/externalstorage</privilege>");
            }
            if (TizenUtilities.ThisIsAUnityTestProject())
            {
                writer.WriteLine("\t\t<privilege>http://tizen.org/privilege/internet</privilege>");
            }
            TizenUtilities.WriteCapabilitiesToManifest(writer);
            writer.WriteLine("\t</privileges>");
            writer.WriteLine("</manifest>");
            writer.Close();
            string[] source = File.ReadAllLines(manifestPath);
            File.WriteAllLines(manifestPath, source.Distinct <string>().ToArray <string>());
        }