microsoft.build.tasks.MSBuild Maven / Gradle / Ivy
Show all versions of jcoreflector_net462 Show documentation
/*
* MIT License
*
* Copyright (c) 2024 MASES s.r.l.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/**************************************************************************************
*
* This code was generated from a template using JCOReflector v. 1.14.0.0
*
* Manual changes to this file may cause unexpected behavior in your application.
* Manual changes to this file will be overwritten if the code is regenerated.
*
*************************************************************************************/
package microsoft.build.tasks;
import org.mases.jcobridge.*;
import org.mases.jcobridge.netreflection.*;
import java.util.ArrayList;
// Import section
import microsoft.build.tasks.TaskExtension;
import microsoft.build.framework.ITaskItem;
import microsoft.build.framework.ITaskItemImplementation;
/**
* The base .NET class managing Microsoft.Build.Tasks.MSBuild, Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
*
*
* .NET documentation at https://docs.microsoft.com/en-us/dotnet/api/Microsoft.Build.Tasks.MSBuild
*
*
* Powered by JCOBridge: more info at https://www.jcobridge.com
*
* @author MASES s.r.l https://masesgroup.com
* @version 1.14.0.0
*/
public class MSBuild extends TaskExtension {
/**
* Fully assembly qualified name: Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
*/
public static final String assemblyFullName = "Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
/**
* Assembly name: Microsoft.Build.Tasks.v4.0
*/
public static final String assemblyShortName = "Microsoft.Build.Tasks.v4.0";
/**
* Qualified class name: Microsoft.Build.Tasks.MSBuild
*/
public static final String className = "Microsoft.Build.Tasks.MSBuild";
static JCOBridge bridge = JCOBridgeInstance.getInstance(assemblyFullName);
/**
* The type managed from JCOBridge. See {@link JCType}
*/
public static JCType classType = createType();
static JCEnum enumInstance = null;
JCObject classInstance = null;
static JCType createType() {
try {
String classToCreate = className + ", "
+ (JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
if (JCOReflector.getDebug())
JCOReflector.writeLog("Creating %s", classToCreate);
JCType typeCreated = bridge.GetType(classToCreate);
if (JCOReflector.getDebug())
JCOReflector.writeLog("Created: %s",
(typeCreated != null) ? typeCreated.toString() : "Returned null value");
return typeCreated;
} catch (JCException e) {
JCOReflector.writeLog(e);
return null;
}
}
void addReference(String ref) throws Throwable {
try {
bridge.AddReference(ref);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
/**
* Internal constructor. Use with caution
*/
public MSBuild(java.lang.Object instance) throws Throwable {
super(instance);
if (instance instanceof JCObject) {
classInstance = (JCObject) instance;
} else
throw new Exception("Cannot manage object, it is not a JCObject");
}
public String getJCOAssemblyName() {
return assemblyFullName;
}
public String getJCOClassName() {
return className;
}
public String getJCOObjectName() {
return className + ", " + (JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
}
public java.lang.Object getJCOInstance() {
return classInstance;
}
public void setJCOInstance(JCObject instance) {
classInstance = instance;
super.setJCOInstance(classInstance);
}
public JCType getJCOType() {
return classType;
}
/**
* Try to cast the {@link IJCOBridgeReflected} instance into {@link MSBuild}, a cast assert is made to check if types are compatible.
* @param from {@link IJCOBridgeReflected} instance to be casted
* @return {@link MSBuild} instance
* @throws java.lang.Throwable in case of error during cast operation
*/
public static MSBuild cast(IJCOBridgeReflected from) throws Throwable {
NetType.AssertCast(classType, from);
return new MSBuild(from.getJCOInstance());
}
// Constructors section
public MSBuild() throws Throwable, system.ArgumentNullException {
try {
// add reference to assemblyName.dll file
addReference(JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
setJCOInstance((JCObject)classType.NewObject());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
// Methods section
public boolean Execute() throws Throwable, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.ArgumentException, system.FormatException, system.IndexOutOfRangeException, system.resources.MissingManifestResourceException, system.NotImplementedException, system.ObjectDisposedException, system.InvalidOperationException, system.globalization.CultureNotFoundException, system.text.regularexpressions.RegexMatchTimeoutException, system.NotSupportedException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.IOException, system.io.PathTooLongException, system.io.DriveNotFoundException, system.OperationCanceledException {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (boolean)classInstance.Invoke("Execute");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
// Properties section
public boolean getBuildInParallel() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (boolean)classInstance.Get("BuildInParallel");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setBuildInParallel(boolean BuildInParallel) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("BuildInParallel", BuildInParallel);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public boolean getRebaseOutputs() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (boolean)classInstance.Get("RebaseOutputs");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setRebaseOutputs(boolean RebaseOutputs) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("RebaseOutputs", RebaseOutputs);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public boolean getRunEachTargetSeparately() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (boolean)classInstance.Get("RunEachTargetSeparately");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setRunEachTargetSeparately(boolean RunEachTargetSeparately) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("RunEachTargetSeparately", RunEachTargetSeparately);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public boolean getStopOnFirstFailure() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (boolean)classInstance.Get("StopOnFirstFailure");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setStopOnFirstFailure(boolean StopOnFirstFailure) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("StopOnFirstFailure", StopOnFirstFailure);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public boolean getUnloadProjectsOnCompletion() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (boolean)classInstance.Get("UnloadProjectsOnCompletion");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setUnloadProjectsOnCompletion(boolean UnloadProjectsOnCompletion) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("UnloadProjectsOnCompletion", UnloadProjectsOnCompletion);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public boolean getUseResultsCache() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (boolean)classInstance.Get("UseResultsCache");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setUseResultsCache(boolean UseResultsCache) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("UseResultsCache", UseResultsCache);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public final ITaskItem[] getProjects() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
ArrayList resultingArrayList = new ArrayList();
JCObject resultingObjects = (JCObject)classInstance.Get("Projects");
for (java.lang.Object resultingObject : resultingObjects) {
resultingArrayList.add(new ITaskItemImplementation(resultingObject));
}
ITaskItem[] resultingArray = new ITaskItem[resultingArrayList.size()];
resultingArray = resultingArrayList.toArray(resultingArray);
return resultingArray;
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setProjects(ITaskItem[] Projects) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("Projects", toObjectFromArray(Projects));
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public final ITaskItem[] getTargetOutputs() throws Throwable, system.ArgumentNullException, system.ArgumentOutOfRangeException, system.ArgumentException, system.NotSupportedException {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
ArrayList resultingArrayList = new ArrayList();
JCObject resultingObjects = (JCObject)classInstance.Get("TargetOutputs");
for (java.lang.Object resultingObject : resultingObjects) {
resultingArrayList.add(new ITaskItemImplementation(resultingObject));
}
ITaskItem[] resultingArray = new ITaskItem[resultingArrayList.size()];
resultingArray = resultingArrayList.toArray(resultingArray);
return resultingArray;
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public java.lang.String getRemoveProperties() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (java.lang.String)classInstance.Get("RemoveProperties");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setRemoveProperties(java.lang.String RemoveProperties) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("RemoveProperties", RemoveProperties);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public java.lang.String getSkipNonexistentProjects() throws Throwable, system.ArgumentNullException, system.ArgumentException, system.InvalidOperationException, system.MissingMethodException, system.reflection.TargetInvocationException, system.globalization.CultureNotFoundException, system.ArgumentOutOfRangeException, system.OutOfMemoryException, system.FormatException, system.IndexOutOfRangeException {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (java.lang.String)classInstance.Get("SkipNonexistentProjects");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setSkipNonexistentProjects(java.lang.String SkipNonexistentProjects) throws Throwable, system.ArgumentException, system.ArgumentNullException, system.TypeLoadException, system.InvalidOperationException, system.MissingMethodException, system.reflection.TargetInvocationException, system.NotSupportedException, system.globalization.CultureNotFoundException, system.IndexOutOfRangeException, system.resources.MissingManifestResourceException, system.ArgumentOutOfRangeException {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("SkipNonexistentProjects", SkipNonexistentProjects);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public java.lang.String getToolsVersion() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (java.lang.String)classInstance.Get("ToolsVersion");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setToolsVersion(java.lang.String ToolsVersion) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("ToolsVersion", ToolsVersion);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public java.lang.String[] getProperties() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
ArrayList resultingArrayList = new ArrayList();
JCObject resultingObjects = (JCObject)classInstance.Get("Properties");
for (java.lang.Object resultingObject : resultingObjects) {
resultingArrayList.add(resultingObject);
}
java.lang.String[] resultingArray = new java.lang.String[resultingArrayList.size()];
for(int indexProperties = 0; indexProperties < resultingArrayList.size(); indexProperties++ ) {
resultingArray[indexProperties] = (java.lang.String)resultingArrayList.get(indexProperties);
}
return resultingArray;
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setProperties(java.lang.String[] Properties) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("Properties", Properties);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public java.lang.String[] getTargetAndPropertyListSeparators() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
ArrayList resultingArrayList = new ArrayList();
JCObject resultingObjects = (JCObject)classInstance.Get("TargetAndPropertyListSeparators");
for (java.lang.Object resultingObject : resultingObjects) {
resultingArrayList.add(resultingObject);
}
java.lang.String[] resultingArray = new java.lang.String[resultingArrayList.size()];
for(int indexTargetAndPropertyListSeparators = 0; indexTargetAndPropertyListSeparators < resultingArrayList.size(); indexTargetAndPropertyListSeparators++ ) {
resultingArray[indexTargetAndPropertyListSeparators] = (java.lang.String)resultingArrayList.get(indexTargetAndPropertyListSeparators);
}
return resultingArray;
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setTargetAndPropertyListSeparators(java.lang.String[] TargetAndPropertyListSeparators) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("TargetAndPropertyListSeparators", TargetAndPropertyListSeparators);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public java.lang.String[] getTargets() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
ArrayList resultingArrayList = new ArrayList();
JCObject resultingObjects = (JCObject)classInstance.Get("Targets");
for (java.lang.Object resultingObject : resultingObjects) {
resultingArrayList.add(resultingObject);
}
java.lang.String[] resultingArray = new java.lang.String[resultingArrayList.size()];
for(int indexTargets = 0; indexTargets < resultingArrayList.size(); indexTargets++ ) {
resultingArray[indexTargets] = (java.lang.String)resultingArrayList.get(indexTargets);
}
return resultingArray;
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setTargets(java.lang.String[] Targets) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("Targets", Targets);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
// Instance Events section
}