Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up build configurations and references for GSA10.1 build #243

Merged
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions GSA_Adapter/AdapterActions/Execute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@

namespace BH.Adapter.GSA
{
#if GSA_10_1
public partial class GSA_10_1Adapter
#elif GSA_8_7
public partial class GSA_8_7Adapter
#else
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What version of GSA will the default GSAAdapter be targetting?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default build is targeting GSA 8.7. WHat I did though is that I did not define any constants for the default debug and release builds, so they should still revert to the #else case. This essentially means that we will have two identical builds. GSAAdapter and GSA8_7Adapter will be doing the exact same thing.

My reasoning for setting it up this way is that I did not want this PR to impact the beta release in any way at all. Plan (which I will document on the issue if we agree with this strategy) is that we remove the GSAAdapter in milestone 4.3, with proper versioning and everything, and only have the versioned builds left. Basically, remove default Debug and Release builds and remove the else statement.

Does that make sense?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That does make sense.

If we don't change the configs for the installer (which is what we're recommending here, only adding one for core) then the 4.2 beta will be unchanged, so then doing a full upgrade in 4.3 with versioning is probably a good plan, I'd support that as a roll out.

public partial class GSAAdapter
#endif
{
/***************************************************/
/**** IAdapter Interface ****/
Expand Down
6 changes: 6 additions & 0 deletions GSA_Adapter/AdapterActions/Pull.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@

namespace BH.Adapter.GSA
{
#if GSA_10_1
public partial class GSA_10_1Adapter
#elif GSA_8_7
public partial class GSA_8_7Adapter
#else
public partial class GSAAdapter
#endif
{
public override IEnumerable<object> Pull(IRequest request, PullType pullType = PullType.AdapterDefault, ActionConfig actionConfig = null)
{
Expand Down
6 changes: 6 additions & 0 deletions GSA_Adapter/CRUD/Create.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@

namespace BH.Adapter.GSA
{
#if GSA_10_1
public partial class GSA_10_1Adapter
#elif GSA_8_7
public partial class GSA_8_7Adapter
#else
public partial class GSAAdapter
#endif
{
/***************************************************/
/**** Index Adapter Interface ****/
Expand Down
8 changes: 7 additions & 1 deletion GSA_Adapter/CRUD/Delete.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,14 @@

namespace BH.Adapter.GSA
{
#if GSA_10_1
public partial class GSA_10_1Adapter
#elif GSA_8_7
public partial class GSA_8_7Adapter
#else
public partial class GSAAdapter
{
#endif
{
/***************************************************/
/**** Index Adapter Methods ****/
/***************************************************/
Expand Down
12 changes: 11 additions & 1 deletion GSA_Adapter/CRUD/Read.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
*/


#if GSA_10_1
using Interop.Gsa_10_1;
#else
using Interop.gsa_8_7;
#endif
using BH.oM.Base;
using BH.oM.Structure.MaterialFragments;
using BH.oM.Structure.Elements;
Expand All @@ -32,7 +37,6 @@
using BH.oM.Structure.Results;
using BH.oM.Structure.Requests;
using BH.oM.Analytical.Results;
using Interop.gsa_8_7;
using System;
using BH.Engine.Adapter;
using BH.oM.Adapters.GSA;
Expand All @@ -44,7 +48,13 @@

namespace BH.Adapter.GSA
{
#if GSA_10_1
public partial class GSA_10_1Adapter
#elif GSA_8_7
public partial class GSA_8_7Adapter
#else
public partial class GSAAdapter
#endif
{
/***************************************************/
/**** Index Adapter Methods ****/
Expand Down
6 changes: 6 additions & 0 deletions GSA_Adapter/CRUD/ReadResults.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@

namespace BH.Adapter.GSA
{
#if GSA_10_1
public partial class GSA_10_1Adapter
#elif GSA_8_7
public partial class GSA_8_7Adapter
#else
public partial class GSAAdapter
#endif
{

/***************************************************/
Expand Down
13 changes: 12 additions & 1 deletion GSA_Adapter/CRUD/ReadResultsElements.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,17 @@
* along with this code. If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
*/


#if GSA_10_1
using Interop.Gsa_10_1;
#else
using Interop.gsa_8_7;
#endif
using BH.oM.Base;
using BH.oM.Analytical.Results;
using BH.oM.Structure.Requests;
using BH.oM.Data.Requests;
using BH.oM.Adapter;
using Interop.gsa_8_7;
using System;
using BH.Engine.Adapter;
using BH.oM.Adapters.GSA;
Expand All @@ -36,7 +41,13 @@

namespace BH.Adapter.GSA
{
#if GSA_10_1
public partial class GSA_10_1Adapter
#elif GSA_8_7
public partial class GSA_8_7Adapter
#else
public partial class GSAAdapter
#endif
{

public delegate IResult ForceConverter(GsaResults results, int id, string loadCase, int divisions, double timeStep = 0, int mode = -1);
Expand Down
12 changes: 11 additions & 1 deletion GSA_Adapter/CRUD/ReadResultsGlobal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,18 @@
*/


#if GSA_10_1
using Interop.Gsa_10_1;
#else
using Interop.gsa_8_7;
#endif
using BH.oM.Base;
using BH.oM.Analytical.Results;
using BH.oM.Adapter;
using BH.oM.Structure.Elements;
using BH.oM.Structure.Requests;
using BH.oM.Data.Requests;
using BH.oM.Structure.Results;
using Interop.gsa_8_7;
using System;
using BH.Engine.Adapter;
using BH.oM.Adapters.GSA;
Expand All @@ -38,7 +42,13 @@

namespace BH.Adapter.GSA
{
#if GSA_10_1
public partial class GSA_10_1Adapter
#elif GSA_8_7
public partial class GSA_8_7Adapter
#else
public partial class GSAAdapter
#endif
{

/***************************************************/
Expand Down
6 changes: 6 additions & 0 deletions GSA_Adapter/CRUD/Update.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@

namespace BH.Adapter.GSA
{
#if GSA_10_1
public partial class GSA_10_1Adapter
#elif GSA_8_7
public partial class GSA_8_7Adapter
#else
public partial class GSAAdapter
#endif
{
/***************************************************/
/**** Adapter Methods ****/
Expand Down
6 changes: 6 additions & 0 deletions GSA_Adapter/CRUD/UpdateProperty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@

namespace BH.Adapter.GSA
{
#if GSA_10_1
public partial class GSA_10_1Adapter
#elif GSA_8_7
public partial class GSA_8_7Adapter
#else
public partial class GSAAdapter
#endif
{
protected override int IUpdateTags(Type type, IEnumerable<object> ids, IEnumerable<HashSet<string>> newTags, ActionConfig actionConfig = null)
{
Expand Down
6 changes: 5 additions & 1 deletion GSA_Adapter/Convert/FromGsa/Elements/Bar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,17 @@
* along with this code. If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
*/

#if GSA_10_1
using Interop.Gsa_10_1;
#else
using Interop.gsa_8_7;
#endif
using BH.Engine.Serialiser;
using BH.Engine.Adapter;
using BH.oM.Adapters.GSA;
using BH.oM.Structure.Elements;
using BH.oM.Structure.SectionProperties;
using BH.oM.Structure.Constraints;
using Interop.gsa_8_7;
using System;
using System.Collections.Generic;

Expand Down
6 changes: 5 additions & 1 deletion GSA_Adapter/Convert/FromGsa/Elements/FEMesh.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@
* along with this code. If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
*/

#if GSA_10_1
using Interop.Gsa_10_1;
#else
using Interop.gsa_8_7;
#endif
using BH.Engine.Serialiser;
using BH.Engine.Adapter;
using BH.oM.Adapters.GSA;
using BH.oM.Structure.Elements;
using BH.oM.Structure.SurfaceProperties;
using Interop.gsa_8_7;
using System.Collections.Generic;
using System.Linq;

Expand Down
6 changes: 5 additions & 1 deletion GSA_Adapter/Convert/FromGsa/Elements/RigidLink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@
* along with this code. If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
*/

#if GSA_10_1
using Interop.Gsa_10_1;
#else
using Interop.gsa_8_7;
#endif
using BH.Engine.Serialiser;
using BH.Engine.Adapter;
using BH.oM.Adapters.GSA;
using BH.oM.Structure.Elements;
using BH.oM.Structure.Constraints;
using Interop.gsa_8_7;
using System.Collections.Generic;


Expand Down
7 changes: 6 additions & 1 deletion GSA_Adapter/Convert/FromGsa/Elements/Spacer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,18 @@
* along with this code. If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
*/


#if GSA_10_1
using Interop.Gsa_10_1;
#else
using Interop.gsa_8_7;
#endif
using BH.Engine.Serialiser;
using BH.Engine.Adapter;
using BH.oM.Adapters.GSA;
using BH.oM.Structure.Elements;
using BH.oM.Structure.SectionProperties;
using BH.oM.Structure.Constraints;
using Interop.gsa_8_7;
using System;
using System.Collections.Generic;
using BH.oM.Adapters.GSA.SpacerProperties;
Expand Down
4 changes: 4 additions & 0 deletions GSA_Adapter/Convert/FromGsa/Results/Results.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
* along with this code. If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
*/

#if GSA_10_1
using Interop.Gsa_10_1;
#else
using Interop.gsa_8_7;
#endif
using System;
using BH.Engine.Adapter;
using BH.oM.Adapters.GSA;
Expand Down
4 changes: 2 additions & 2 deletions GSA_Adapter/Convert/ToGsa/Properties/SectionProperty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ private static bool CreateDescAndPropString(ISectionProperty secProp, out string
//Fallback method for section types not implemented.
prop = "NO_PROP";
desc = "";
GSAAdapter.NotSupportedWarning(secProp.GetType(), "Section properties");
NotSupportedWarning(secProp.GetType(), "Section properties");
return false;
}

Expand Down Expand Up @@ -424,7 +424,7 @@ private static bool CreateDescString(RectangleProfile dimensions, out string des

private static bool CreateDescString(IProfile profile, out string desc)
{
GSAAdapter.NotSupportedWarning(profile.GetType(), "Section profiles");
NotSupportedWarning(profile.GetType(), "Section profiles");
desc = "";
return false;
}
Expand Down
13 changes: 12 additions & 1 deletion GSA_Adapter/Convert/ToGsa/_ToGsa.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
using System.ComponentModel;
using BH.oM.Adapters.GSA.SpacerProperties;
using BH.oM.Adapters.GSA.Elements;
using BH.oM.Reflection.Attributes;


namespace BH.Adapter.GSA
Expand Down Expand Up @@ -86,6 +87,16 @@ public static string ToGSACleanName(this string name)
return name;
}

/***************************************************/

[Description("Raises a warning for types not supported")]
[Input("type", "The type not supported")]
[Input("category", "The object category to raise a warning for. Defaults to object")]
IsakNaslundBh marked this conversation as resolved.
Show resolved Hide resolved
public static void NotSupportedWarning(Type type, string category = "Objects")
{
Engine.Reflection.Compute.RecordWarning(category + " of type " + type.FullName + " are not supported in the GSA Adapter");
}

/***************************************************/
/**** Public Interface Methods ****/
/***************************************************/
Expand All @@ -101,7 +112,7 @@ public static string IToGsaString(this object obj, string index)

public static string ToGsaString(this object obj, string index)
{
GSAAdapter.NotSupportedWarning(obj.GetType());
NotSupportedWarning(obj.GetType());
return "";
}

Expand Down
24 changes: 17 additions & 7 deletions GSA_Adapter/GSAAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
* along with this code. If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
*/

#if GSA_10_1
using Interop.Gsa_10_1;
#else
using Interop.gsa_8_7;
#endif
using BH.oM.Adapters.GSA;
using System.ComponentModel;
using System;
Expand All @@ -40,13 +44,25 @@

namespace BH.Adapter.GSA
{
#if GSA_10_1
public partial class GSA_10_1Adapter : BHoMAdapter
#elif GSA_8_7
public partial class GSA_8_7Adapter : BHoMAdapter
#else
public partial class GSAAdapter : BHoMAdapter
#endif
{
/***************************************************/
/**** Constructors ****/
/***************************************************/

#if GSA_10_1
public GSA_10_1Adapter(string filePath = "", GSAConfig gsaConfig = null, bool active = false)
#elif GSA_8_7
public GSA_8_7Adapter(string filePath = "", GSAConfig gsaConfig = null, bool active = false)
#else
public GSAAdapter(string filePath = "", GSAConfig gsaConfig = null, bool active = false)
#endif
{
AdapterIdFragmentType = typeof(GSAId);

Expand Down Expand Up @@ -96,13 +112,7 @@ public GSAAdapter(string filePath = "", GSAConfig gsaConfig = null, bool active
/**** Public Methods ****/
/***************************************************/

[Description("Raises a warning for types not supported")]
[Input("type", "The type not supported")]
[Input("category", "The object category to raise a warning for. Defaults to object")]
public static void NotSupportedWarning(Type type, string category = "Objects")
{
Engine.Reflection.Compute.RecordWarning(category + " of type " + type.FullName + " are not supported in the GSA Adapter");
}


/***************************************************/
/**** Private Methods - Com Interop ****/
Expand Down
Loading