public override bool Execute() { if (SourceJars == null || SourceJars.Count() == 0) { Log.LogError("At least one Java library is required for binding, this must be either 'EmbeddedJar', 'InputJar' (for jar), 'LibraryProjectZip' (for aar or zip) or 'LibraryProjectProperties' (project.properties) build action."); return(false); } // Ensure that the user has the platform they are targeting installed var jarpath = MonoAndroidHelper.TryGetAndroidJarPath(Log, AndroidApiLevel); if (jarpath == null) { return(!Log.HasLoggedErrors); } // Ensure that all requested jars exist foreach (var jar in SourceJars) { if (!File.Exists(jar.ItemSpec)) { Log.LogError("Specified source jar not found: {0}", jar.ItemSpec); } } if (ReferenceJars != null) { foreach (var jar in ReferenceJars) { if (!File.Exists(jar.ItemSpec)) { Log.LogError("Specified reference jar not found: {0}", jar.ItemSpec); } } } if (Log.HasLoggedErrors) { return(false); } // Ensure our output directory exists Directory.CreateDirectory(Path.GetDirectoryName(OutputFile)); return(base.Execute()); }
public override bool RunTask() { if (SourceJars == null || SourceJars.Count() == 0) { Log.LogCodedError("XA1020", Properties.Resources.XA1020); return(false); } // Ensure that the user has the platform they are targeting installed var jarpath = MonoAndroidHelper.TryGetAndroidJarPath(Log, AndroidApiLevel); if (jarpath == null) { return(!Log.HasLoggedErrors); } // Ensure that all requested jars exist foreach (var jar in SourceJars) { if (!File.Exists(jar.ItemSpec)) { Log.LogCodedError("XA1021", Properties.Resources.XA1021, jar.ItemSpec); } } if (ReferenceJars != null) { foreach (var jar in ReferenceJars) { if (!File.Exists(jar.ItemSpec)) { Log.LogCodedError("XA1022", Properties.Resources.XA1022, jar.ItemSpec); } } } if (Log.HasLoggedErrors) { return(false); } // Ensure our output directory exists Directory.CreateDirectory(Path.GetDirectoryName(OutputFile)); return(base.RunTask()); }
public override bool Execute() { Log.LogDebugMessage("JarToXml Task"); Log.LogDebugMessage(" JavaOptions: {0}", JavaOptions); Log.LogDebugMessage(" JavaMaximumHeapSize: {0}", JavaMaximumHeapSize); Log.LogDebugMessage(" AndroidSdkDirectory: {0}", AndroidSdkDirectory); Log.LogDebugMessage(" AndroidApiLevel: {0}", AndroidApiLevel); Log.LogDebugMessage(" MonoAndroidToolsDirectory: {0}", MonoAndroidToolsDirectory); Log.LogDebugMessage(" JavaSdkDirectory: {0}", JavaSdkDirectory); Log.LogDebugMessage(" OutputFile: {0}", OutputFile); Log.LogDebugMessage(" DroidDocPaths: {0}", DroidDocPaths); Log.LogDebugMessage(" JavaDocPaths: {0}", JavaDocPaths); Log.LogDebugMessage(" Java7DocPaths: {0}", Java7DocPaths); Log.LogDebugMessage(" Java8DocPaths: {0}", Java8DocPaths); Log.LogDebugTaskItems(" JavaDocs: {0}", JavaDocs); Log.LogDebugTaskItems(" LibraryProjectJars:", LibraryProjectJars); Log.LogDebugTaskItems(" SourceJars:", SourceJars); Log.LogDebugTaskItems(" ReferenceJars:", ReferenceJars); if (SourceJars == null || SourceJars.Count() == 0) { Log.LogError("At least one Java library is required for binding, this must be either 'EmbeddedJar', 'InputJar' (for jar), 'LibraryProjectZip' (for aar or zip) or 'LibraryProjectProperties' (project.properties) build action."); return(false); } // Ensure that the user has the platform they are targeting installed var jarpath = Path.Combine(MonoAndroidHelper.AndroidSdk.TryGetPlatformDirectoryFromApiLevel(AndroidApiLevel, MonoAndroidHelper.SupportedVersions), "android.jar"); if (!File.Exists(jarpath)) { Log.LogError("Could not find android.jar for API Level {0}. This means the Android SDK platform for API Level {0} is not installed. Either install it in the Android SDK Manager, or change your Android Bindings project to target an API version that is installed. ({1} missing.)", AndroidApiLevel, jarpath); return(false); } // Ensure that all requested jars exist foreach (var jar in SourceJars) { if (!File.Exists(jar.ItemSpec)) { Log.LogError("Specified source jar not found: {0}", jar.ItemSpec); } } if (ReferenceJars != null) { foreach (var jar in ReferenceJars) { if (!File.Exists(jar.ItemSpec)) { Log.LogError("Specified reference jar not found: {0}", jar.ItemSpec); } } } if (Log.HasLoggedErrors) { return(false); } // Ensure our output directory exists Directory.CreateDirectory(Path.GetDirectoryName(OutputFile)); return(base.Execute()); }
public override bool Execute() { Log.LogDebugMessage("JarToXml Task"); Log.LogDebugMessage(" JavaOptions: {0}", JavaOptions); Log.LogDebugMessage(" JavaMaximumHeapSize: {0}", JavaMaximumHeapSize); Log.LogDebugMessage(" AndroidSdkDirectory: {0}", AndroidSdkDirectory); Log.LogDebugMessage(" AndroidApiLevel: {0}", AndroidApiLevel); Log.LogDebugMessage(" MonoAndroidToolsDirectory: {0}", MonoAndroidToolsDirectory); Log.LogDebugMessage(" JavaSdkDirectory: {0}", JavaSdkDirectory); Log.LogDebugMessage(" OutputFile: {0}", OutputFile); Log.LogDebugMessage(" DroidDocPaths: {0}", DroidDocPaths); Log.LogDebugMessage(" JavaDocPaths: {0}", JavaDocPaths); Log.LogDebugMessage(" Java7DocPaths: {0}", Java7DocPaths); Log.LogDebugMessage(" Java8DocPaths: {0}", Java8DocPaths); Log.LogDebugTaskItems(" JavaDocs: {0}", JavaDocs); Log.LogDebugTaskItems(" LibraryProjectJars:", LibraryProjectJars); Log.LogDebugTaskItems(" SourceJars:", SourceJars); Log.LogDebugTaskItems(" ReferenceJars:", ReferenceJars); if (SourceJars == null || SourceJars.Count() == 0) { Log.LogError("At least one Java library is required for binding, this must be either 'EmbeddedJar', 'InputJar' (for jar), 'LibraryProjectZip' (for aar or zip) or 'LibraryProjectProperties' (project.properties) build action."); return(false); } // Ensure that the user has the platform they are targeting installed var jarpath = MonoAndroidHelper.TryGetAndroidJarPath(Log, AndroidApiLevel); if (jarpath == null) { return(!Log.HasLoggedErrors); } // Ensure that all requested jars exist foreach (var jar in SourceJars) { if (!File.Exists(jar.ItemSpec)) { Log.LogError("Specified source jar not found: {0}", jar.ItemSpec); } } if (ReferenceJars != null) { foreach (var jar in ReferenceJars) { if (!File.Exists(jar.ItemSpec)) { Log.LogError("Specified reference jar not found: {0}", jar.ItemSpec); } } } if (Log.HasLoggedErrors) { return(false); } // Ensure our output directory exists Directory.CreateDirectory(Path.GetDirectoryName(OutputFile)); return(base.Execute()); }