void CompileJava(IEnumerable <string> files)
        {
            if (Options.Compilation.Platform == TargetPlatform.Android)
            {
                if (!initXamarinAndroidTools)
                {
                    AndroidLogger.Info     += AndroidLogger_Info;
                    AndroidLogger.Error    += AndroidLogger_Error;
                    initXamarinAndroidTools = true;
                }

                AndroidSdk.Refresh();
            }

            var executableSuffix = Platform.IsWindows ? ".exe" : string.Empty;
            var javac            = $"{Path.Combine(GetJavaSdkPath(), "bin", "javac" + executableSuffix)}";

            var args = new List <string> {
                string.Join(" ", files.Select(file => Path.GetFullPath(file)))
            };

            if (Options.Compilation.DebugMode)
            {
                args.Add("-g");
            }

            var invocation = string.Join(" ", args);

            Invoke(javac, invocation);
        }
示例#2
0
        static XamarinAndroid()
        {
            AndroidLogger.Info    += AndroidLogger_Info;
            AndroidLogger.Warning += AndroidLogger_Warning;
            AndroidLogger.Error   += AndroidLogger_Error;

            AndroidSdk.Refresh();
        }
示例#3
0
        void RefreshAndroidSdk()
        {
            if (Options.Compilation.Platform == TargetPlatform.Android)
            {
                if (!initXamarinAndroidTools)
                {
                    AndroidLogger.Info     += AndroidLogger_Info;
                    AndroidLogger.Error    += AndroidLogger_Error;
                    initXamarinAndroidTools = true;
                }

                AndroidSdk.Refresh();
            }
        }
 public static void RefreshAndroidSdk(string sdkPath, string ndkPath, string javaPath)
 {
     AndroidSdk.Refresh(sdkPath, ndkPath, javaPath);
 }