Пример #1
0
    public static void PerformiOSBuild()
    {
        PlayerSettings.iOS.sdkVersion = iOSSdkVersion.DeviceSDK;
        string originalVersion = PlayerSettings.iOS.buildNumber;

        PlayerSettings.iOS.buildNumber = EnvUtil.GetEnvValue(ENV_BUILD_NUMBER, originalVersion);
        Build(BuildTargetGroup.iOS, BuildTarget.iOS);
        PlayerSettings.iOS.buildNumber = originalVersion;
    }
Пример #2
0
        private void SetServerPort(int serverPort)
        {
            this.serverPort = serverPort;

            // env first
            var env = EnvUtil.GetEnvValue(NAMING_SERVER_PORT);

            if (!string.IsNullOrWhiteSpace(env) && int.TryParse(env, out var port))
            {
                this.serverPort = port;
            }
        }
        private void InitCacheDir(string @namespace)
        {
            var jmSnapshotPath = EnvUtil.GetEnvValue("JM.SNAPSHOT.PATH");

            if (!string.IsNullOrWhiteSpace(jmSnapshotPath))
            {
                cacheDir = System.IO.Path.Combine(jmSnapshotPath, "nacos", "naming", @namespace);
            }
            else
            {
                cacheDir = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "nacos", "naming", @namespace);
            }
        }
Пример #4
0
    private static void Build(BuildTargetGroup group, BuildTarget target)
    {
        string buildPath = EnvUtil.GetEnvValue(ENV_OUTPUT_DIR, Default_OutputPath);

        Directory.CreateDirectory(buildPath);

        string originalId = PlayerSettings.applicationIdentifier;

        PlayerSettings.applicationIdentifier = EnvUtil.GetEnvValue(ENV_BUNDLE_IDENTIFIER, originalId);

        string originalD = PlayerSettings.GetScriptingDefineSymbolsForGroup(group);

        PlayerSettings.SetScriptingDefineSymbolsForGroup(group, originalD + ";" + EnvUtil.GetEnvValue(ENV_DEFINE_SYMBOLS));

        string       release = EnvUtil.GetEnvValue(ENV_BUILD_OPT_RELEASE, "1");
        BuildOptions opt;

        if (release.Equals("1"))
        {
            opt = BuildOptions.None;
        }
        else
        {
            opt = BuildOptions.Development | BuildOptions.ConnectWithProfiler | BuildOptions.AllowDebugging | BuildOptions.SymlinkLibraries;
        }

        BuildPlayerOptions options = new BuildPlayerOptions();

        options.targetGroup = group;
        options.target      = target;
        options.scenes      = ProjectBuilder.FindEnabledEditorScenes();
        if (group == BuildTargetGroup.Android)
        {
            string outputName = EnvUtil.GetEnvValue(ENV_OUTPUT_NAME, PlayerSettings.productName + ".apk");
            options.locationPathName = Path.Combine(buildPath, outputName);
        }
        else
        {
            options.locationPathName = buildPath;
        }
        options.options = opt;

        if (ProjectBuilder.GenericBuild(options))
        {
        }
        else
        {
        }
        PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup.Android, originalD);
        PlayerSettings.applicationIdentifier = originalId;
    }
Пример #5
0
    public static void PerformAndroidBuild()
    {
        PlayerSettings.Android.keystoreName = EnvUtil.GetEnvValue(ENV_KEYSTORE_PATH);
        PlayerSettings.Android.keystorePass = EnvUtil.GetEnvValue(ENV_KEYSTORE_PASS);
        PlayerSettings.Android.keyaliasName = EnvUtil.GetEnvValue(ENV_KEY_ALIAS_NAME);
        PlayerSettings.Android.keyaliasPass = EnvUtil.GetEnvValue(ENV_KEY_ALIAS_PASS);


        int originalVersion = PlayerSettings.Android.bundleVersionCode;

        PlayerSettings.Android.bundleVersionCode = int.Parse(EnvUtil.GetEnvValue(ENV_BUILD_NUMBER, originalVersion.ToString()));

        Build(BuildTargetGroup.Android, BuildTarget.Android);

        PlayerSettings.Android.bundleVersionCode = originalVersion;
    }
Пример #6
0
        protected Dictionary <string, string> GetCommonHeader()
        {
            var headers = new Dictionary <string, string>(16);

            string ts = DateTimeOffset.Now.ToUnixTimeMilliseconds().ToString();

            var    appKey = EnvUtil.GetEnvValue("nacos.client.appKey");
            string token  = HashUtil.GetMd5(ts + (appKey.IsNullOrWhiteSpace() ? "" : appKey));

            headers[Constants.CLIENT_APPNAME_HEADER]        = AppDomain.CurrentDomain.FriendlyName;
            headers[Constants.CLIENT_REQUEST_TS_HEADER]     = ts;
            headers[Constants.CLIENT_REQUEST_TOKEN_HEADER]  = token;
            headers[HttpHeaderConsts.CLIENT_VERSION_HEADER] = Constants.CLIENT_VERSION;
            headers["exConfigInfo"] = "true";
            headers[HttpHeaderConsts.REQUEST_ID]     = Guid.NewGuid().ToString("N");
            headers[HttpHeaderConsts.ACCEPT_CHARSET] = "UTF-8";
            return(headers);
        }
Пример #7
0
        private void InitCacheDir(string @namespace, NacosSdkOptions options)
        {
            var jmSnapshotPath = EnvUtil.GetEnvValue("JM.SNAPSHOT.PATH");

            string namingCacheRegistryDir = string.Empty;

            if (options.NamingCacheRegistryDir.IsNotNullOrWhiteSpace())
            {
                namingCacheRegistryDir = options.NamingCacheRegistryDir;
            }

            if (!string.IsNullOrWhiteSpace(jmSnapshotPath))
            {
                cacheDir = Path.Combine(jmSnapshotPath, FILE_PATH_NACOS, FILE_PATH_NAMING, @namespace);
            }
            else
            {
                cacheDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), FILE_PATH_NACOS, FILE_PATH_NAMING, @namespace);
            }
        }
Пример #8
0
        /// <summary>
        /// get connection type for remote.
        /// </summary>
        /// <returns>connection type</returns>
        public static string ConfigRemoteConnectionType()
        {
            string remoteConnectionType = EnvUtil.GetEnvValue("nacos.remote.config.connectiontype");

            return(remoteConnectionType);
        }
Пример #9
0
        /// <summary>
        /// check whether still using http .
        /// </summary>
        /// <returns>use http or not</returns>
        public static bool UseHttpSwitch()
        {
            var useHttpSwitch = EnvUtil.GetEnvValue("clientworker.use.http.switch");

            return("Y".Equals(useHttpSwitch, StringComparison.OrdinalIgnoreCase));
        }
Пример #10
0
 private string GetPushReceiverUdpPort() => EnvUtil.GetEnvValue(PropertyKeyConst.PUSH_RECEIVER_UDP_PORT);
Пример #11
0
 static void BuildAndroidAssetBundle()
 {
     AssetBundleBuildSetting.RelativeOutputPath = EnvUtil.GetEnvValue(ENV_ASSETBUNDLE_OUTPUT, AssetBundleBuildSetting.RelativeOutputPath);
     AssetBundleBuilder.BuildAssetBundle(BuildTarget.Android, AssetBundleBuildSetting.RelativeOutputPath);
 }