Skip to content

Commit

Permalink
Merge pull request #360 from Inxton/fix-an-issue-with-project-file-ov…
Browse files Browse the repository at this point in the history
…erride

fixies an issue when file name from the configuration file in inproperly treated
  • Loading branch information
PTKu authored Jan 21, 2025
2 parents 352922b + d31f23a commit 97f7b6d
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
matrix:
configuration: [Release]

runs-on: [self-hosted, Windows, X64, L2] # For a list of available runner types, refer to
runs-on: [self-hosted, Windows, X64, L2, AX] # For a list of available runner types, refer to
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
matrix:
configuration: [Release]

runs-on: [self-hosted, Windows, X64, L3] # For a list of available runner types, refer to
runs-on: [self-hosted, Windows, X64, L3, AX] # For a list of available runner types, refer to
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
matrix:
configuration: [Release]

runs-on: [self-hosted, Windows, X64, L2] # For a list of available runner types, refer to
runs-on: [self-hosted, Windows, X64, L2, AX] # For a list of available runner types, refer to
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
matrix:
configuration: [Release]

runs-on: [self-hosted, Windows, X64, L3] # For a list of available runner types, refer to
runs-on: [self-hosted, Windows, X64, L3, AX] # For a list of available runner types, refer to
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
steps:
- name: Checkout
Expand Down
4 changes: 4 additions & 0 deletions cake/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ public static void CopyApaxPackages(string sourceDir, string destinationDir, str
{
//swallow
}
catch
{
Console.WriteLine("Failed to delete apax directory");
}
}

}
Expand Down
21 changes: 18 additions & 3 deletions src/AXSharp.compiler/src/AXSharp.Compiler/AXSharpProject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,30 @@ public AXSharpProject(AxProject axProject, IEnumerable<Type> builderTypes, Type
{
AxProject = axProject;
CompilerOptions = AXSharpConfig.UpdateAndGetAXSharpConfig(axProject.ProjectFolder, cliCompilerOptions);
OutputFolder = Path.GetFullPath(Path.Combine(AxProject.ProjectFolder, CompilerOptions.OutputProjectFolder));
if (cliCompilerOptions != null) UseBaseSymbol = cliCompilerOptions.UseBase;

if (CompilerOptions != null)
{
if(string.IsNullOrEmpty(CompilerOptions.OutputProjectFolder))
throw new InvalidOperationException("Output project folder must be set in the AXSharp.config.json file.");
OutputFolder = Path.GetFullPath(Path.Combine(AxProject.ProjectFolder, CompilerOptions.OutputProjectFolder));

if (!string.IsNullOrEmpty(CompilerOptions.ProjectFile))
{
ProjectFile = Path.Combine(OutputFolder, CompilerOptions.ProjectFile);
}
}

if (cliCompilerOptions != null) UseBaseSymbol = cliCompilerOptions.UseBase;
if (cliCompilerOptions != null && !string.IsNullOrEmpty(cliCompilerOptions.ProjectFile)) ProjectFile = cliCompilerOptions.ProjectFile;

BuilderTypes = builderTypes;
TargetProject = Activator.CreateInstance(targetProjectType, this) as ITargetProject ?? throw new
InvalidOperationException("Target project type must implement ITargetProject interface.");


}

public string ProjectFile { get; }


/// <summary>
/// Get AX project.
Expand Down
20 changes: 16 additions & 4 deletions src/AXSharp.compiler/src/AXSharp.Cs.Compiler/CsProject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,29 @@ public class CsProject : ITargetProject
public CsProject(AXSharpProject AXSharpProject)
{
AxSharpProject = AXSharpProject;
ProjectRootNamespace = MakeValidIdentifier(AXSharpProject.AxProject.ProjectInfo.Name);
ProjectRootNamespace = MakeValidIdentifier(AXSharpProject.AxProject.ProjectInfo.Name);
}

private AXSharpProject AxSharpProject { get; }


/// <summary>
/// Gets associated IxProject file.
/// </summary>
public string IxProjectFile => Path.Combine(AxSharpProject.OutputFolder,
$"{MakeValidFileName(AxSharpProject.AxProject.ProjectInfo.Name)}.csproj");
public string IxProjectFile
{
get
{
if(AxSharpProject.ProjectFile == null)
{
return Path.Combine(AxSharpProject.OutputFolder,
$"{MakeValidFileName(AxSharpProject.AxProject.ProjectInfo.Name)}.csproj");
}

return AxSharpProject.ProjectFile;
}
}



/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions src/AXSharp.compiler/src/ixc/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
"commandName": "Project",
"workingDirectory": "C:\\W\\Develop\\gh\\inxton\\_axopen\\axopen\\src\\traversals\\apax\\"
},
"axopen-data": {
"axopen-core": {
"commandName": "Project",
"workingDirectory": "c:\\W\\Develop\\gh\\inxton\\_axopen\\axopen\\src\\data\\app\\"
"workingDirectory": "c:\\W\\Develop\\gh\\inxton\\ax\\axopen\\src\\core\\ctrl\\"
}
}
}

0 comments on commit 97f7b6d

Please sign in to comment.