Skip to content

Commit

Permalink
Add support for studio projects with target framework windows
Browse files Browse the repository at this point in the history
  • Loading branch information
thschmitt committed Dec 20, 2024
1 parent e1e09a6 commit 43b9599
Show file tree
Hide file tree
Showing 16 changed files with 678 additions and 369 deletions.
4 changes: 3 additions & 1 deletion plugin/studio/package_analyze_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ func (c PackageAnalyzeCommand) execute(source string, treatWarningsAsErrors bool
args = append(args, "--stopOnRuleViolation")
}

projectReader := newStudioProjectReader(source)

uipcli := newUipcli(c.Exec, logger)
cmd, err := uipcli.Execute(args...)
cmd, err := uipcli.Execute(projectReader.GetTargetFramework(), args...)
if err != nil {
return 1, nil, err
}
Expand Down
37 changes: 10 additions & 27 deletions plugin/studio/package_pack_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,10 @@ func (c PackagePackCommand) execute(params packagePackParams, debug bool, logger
args = append(args, "--releaseNotes", params.ReleaseNotes)
}

projectReader := newStudioProjectReader(params.Source)

uipcli := newUipcli(c.Exec, logger)
cmd, err := uipcli.Execute(args...)
cmd, err := uipcli.Execute(projectReader.GetTargetFramework(), args...)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -120,7 +122,7 @@ func (c PackagePackCommand) execute(params packagePackParams, debug bool, logger
go c.wait(cmd, &wg)
wg.Wait()

projectJson, err := c.readProjectJson(params.Source)
project, err := projectReader.ReadMetadata()
if err != nil {
return nil, err
}
Expand All @@ -132,16 +134,16 @@ func (c PackagePackCommand) execute(params packagePackParams, debug bool, logger
version := c.extractVersion(nupkgFile)
result = newSucceededPackagePackResult(
filepath.Join(params.Destination, nupkgFile),
projectJson.Name,
projectJson.Description,
projectJson.ProjectId,
project.Name,
project.Description,
project.ProjectId,
version)
} else {
result = newFailedPackagePackResult(
stderrOutputBuilder.String(),
&projectJson.Name,
&projectJson.Description,
&projectJson.ProjectId)
&project.Name,
&project.Description,
&project.ProjectId)
}
return result, nil
}
Expand Down Expand Up @@ -214,25 +216,6 @@ func (c PackagePackCommand) getSource(context plugin.ExecutionContext) (string,
return source, nil
}

func (c PackagePackCommand) readProjectJson(path string) (projectJson, error) {
file, err := os.Open(path)
if err != nil {
return projectJson{}, fmt.Errorf("Error reading %s file: %v", defaultProjectJson, err)
}
defer file.Close()
byteValue, err := io.ReadAll(file)
if err != nil {
return projectJson{}, fmt.Errorf("Error reading %s file: %v", defaultProjectJson, err)
}

var project projectJson
err = json.Unmarshal(byteValue, &project)
if err != nil {
return projectJson{}, fmt.Errorf("Error parsing %s file: %v", defaultProjectJson, err)
}
return project, nil
}

func (c PackagePackCommand) getDestination(context plugin.ExecutionContext) (string, error) {
destination := c.getParameter("destination", context.Parameters)
if destination == "" {
Expand Down
4 changes: 0 additions & 4 deletions plugin/studio/project/.gitignore

This file was deleted.

7 changes: 0 additions & 7 deletions plugin/studio/project_json.go

This file was deleted.

6 changes: 6 additions & 0 deletions plugin/studio/projects/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
crossplatform/*
!crossplatform/Main.xaml
!crossplatform/project.json
windows/*
!windows/Main.xaml
!windows/project.json
Original file line number Diff line number Diff line change
@@ -1,87 +1,87 @@
<Activity mc:Ignorable="sap sap2010" x:Class="Main" sap2010:ExpressionActivityEditor.ExpressionActivityEditor="C#" sap:VirtualizedContainerService.HintSize="1360.8,892.8" sap2010:WorkflowViewState.IdRef="ActivityBuilder_1" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:sap2010="http://schemas.microsoft.com/netfx/2010/xaml/activities/presentation" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=System.Private.CoreLib" xmlns:sco="clr-namespace:System.Collections.ObjectModel;assembly=System.Private.CoreLib" xmlns:ui="http://schemas.uipath.com/workflow/activities" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<TextExpression.NamespacesForImplementation>
<sco:Collection x:TypeArguments="x:String">
<x:String>System.Activities</x:String>
<x:String>System.Activities.Statements</x:String>
<x:String>System.Activities.Expressions</x:String>
<x:String>System.Activities.Validation</x:String>
<x:String>System.Activities.XamlIntegration</x:String>
<x:String>Microsoft.VisualBasic</x:String>
<x:String>Microsoft.VisualBasic.Activities</x:String>
<x:String>System</x:String>
<x:String>System.Collections</x:String>
<x:String>System.Collections.Generic</x:String>
<x:String>System.Collections.ObjectModel</x:String>
<x:String>System.Data</x:String>
<x:String>System.Diagnostics</x:String>
<x:String>System.Drawing</x:String>
<x:String>System.IO</x:String>
<x:String>System.Linq</x:String>
<x:String>System.Net.Mail</x:String>
<x:String>System.Xml</x:String>
<x:String>System.Text</x:String>
<x:String>System.Xml.Linq</x:String>
<x:String>UiPath.Core</x:String>
<x:String>UiPath.Core.Activities</x:String>
<x:String>System.Windows.Markup</x:String>
<x:String>GlobalVariablesNamespace</x:String>
<x:String>GlobalConstantsNamespace</x:String>
<x:String>System.Linq.Expressions</x:String>
<x:String>System.Runtime.Serialization</x:String>
</sco:Collection>
</TextExpression.NamespacesForImplementation>
<TextExpression.ReferencesForImplementation>
<sco:Collection x:TypeArguments="AssemblyReference">
<AssemblyReference>Microsoft.CSharp</AssemblyReference>
<AssemblyReference>Microsoft.VisualBasic</AssemblyReference>
<AssemblyReference>mscorlib</AssemblyReference>
<AssemblyReference>System</AssemblyReference>
<AssemblyReference>System.Activities</AssemblyReference>
<AssemblyReference>System.ComponentModel.TypeConverter</AssemblyReference>
<AssemblyReference>System.Core</AssemblyReference>
<AssemblyReference>System.Data</AssemblyReference>
<AssemblyReference>System.Data.Common</AssemblyReference>
<AssemblyReference>System.Data.DataSetExtensions</AssemblyReference>
<AssemblyReference>System.Drawing</AssemblyReference>
<AssemblyReference>System.Drawing.Common</AssemblyReference>
<AssemblyReference>System.Drawing.Primitives</AssemblyReference>
<AssemblyReference>System.Linq</AssemblyReference>
<AssemblyReference>System.Net.Mail</AssemblyReference>
<AssemblyReference>System.ObjectModel</AssemblyReference>
<AssemblyReference>System.Private.CoreLib</AssemblyReference>
<AssemblyReference>System.Runtime.Serialization</AssemblyReference>
<AssemblyReference>System.ServiceModel</AssemblyReference>
<AssemblyReference>System.ServiceModel.Activities</AssemblyReference>
<AssemblyReference>System.Xaml</AssemblyReference>
<AssemblyReference>System.Xml</AssemblyReference>
<AssemblyReference>System.Xml.Linq</AssemblyReference>
<AssemblyReference>UiPath.System.Activities</AssemblyReference>
<AssemblyReference>UiPath.UiAutomation.Activities</AssemblyReference>
<AssemblyReference>UiPath.Studio.Constants</AssemblyReference>
<AssemblyReference>System.Configuration.ConfigurationManager</AssemblyReference>
<AssemblyReference>System.Security.Permissions</AssemblyReference>
<AssemblyReference>System.Console</AssemblyReference>
<AssemblyReference>System.ComponentModel</AssemblyReference>
<AssemblyReference>System.Memory</AssemblyReference>
<AssemblyReference>System.Private.Uri</AssemblyReference>
<AssemblyReference>System.Linq.Expressions</AssemblyReference>
<AssemblyReference>System.Runtime.Serialization.Formatters</AssemblyReference>
<AssemblyReference>System.Private.DataContractSerialization</AssemblyReference>
<AssemblyReference>System.Runtime.Serialization.Primitives</AssemblyReference>
</sco:Collection>
</TextExpression.ReferencesForImplementation>
<Sequence DisplayName="Main Sequence" sap:VirtualizedContainerService.HintSize="512,254.4" sap2010:WorkflowViewState.IdRef="Sequence_1">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<ui:LogMessage DisplayName="Log Message" sap:VirtualizedContainerService.HintSize="449.6,165.6" sap2010:WorkflowViewState.IdRef="LogMessage_1">
<ui:LogMessage.Message>
<InArgument x:TypeArguments="x:Object">
<CSharpValue x:TypeArguments="x:Object" sap2010:WorkflowViewState.IdRef="CSharpValue`1_1">"Hello World"</CSharpValue>
</InArgument>
</ui:LogMessage.Message>
</ui:LogMessage>
</Sequence>
<Activity mc:Ignorable="sap sap2010" x:Class="Main" sap2010:ExpressionActivityEditor.ExpressionActivityEditor="C#" sap:VirtualizedContainerService.HintSize="1360.8,892.8" sap2010:WorkflowViewState.IdRef="ActivityBuilder_1" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:sap2010="http://schemas.microsoft.com/netfx/2010/xaml/activities/presentation" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=System.Private.CoreLib" xmlns:sco="clr-namespace:System.Collections.ObjectModel;assembly=System.Private.CoreLib" xmlns:ui="http://schemas.uipath.com/workflow/activities" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<TextExpression.NamespacesForImplementation>
<sco:Collection x:TypeArguments="x:String">
<x:String>System.Activities</x:String>
<x:String>System.Activities.Statements</x:String>
<x:String>System.Activities.Expressions</x:String>
<x:String>System.Activities.Validation</x:String>
<x:String>System.Activities.XamlIntegration</x:String>
<x:String>Microsoft.VisualBasic</x:String>
<x:String>Microsoft.VisualBasic.Activities</x:String>
<x:String>System</x:String>
<x:String>System.Collections</x:String>
<x:String>System.Collections.Generic</x:String>
<x:String>System.Collections.ObjectModel</x:String>
<x:String>System.Data</x:String>
<x:String>System.Diagnostics</x:String>
<x:String>System.Drawing</x:String>
<x:String>System.IO</x:String>
<x:String>System.Linq</x:String>
<x:String>System.Net.Mail</x:String>
<x:String>System.Xml</x:String>
<x:String>System.Text</x:String>
<x:String>System.Xml.Linq</x:String>
<x:String>UiPath.Core</x:String>
<x:String>UiPath.Core.Activities</x:String>
<x:String>System.Windows.Markup</x:String>
<x:String>GlobalVariablesNamespace</x:String>
<x:String>GlobalConstantsNamespace</x:String>
<x:String>System.Linq.Expressions</x:String>
<x:String>System.Runtime.Serialization</x:String>
</sco:Collection>
</TextExpression.NamespacesForImplementation>
<TextExpression.ReferencesForImplementation>
<sco:Collection x:TypeArguments="AssemblyReference">
<AssemblyReference>Microsoft.CSharp</AssemblyReference>
<AssemblyReference>Microsoft.VisualBasic</AssemblyReference>
<AssemblyReference>mscorlib</AssemblyReference>
<AssemblyReference>System</AssemblyReference>
<AssemblyReference>System.Activities</AssemblyReference>
<AssemblyReference>System.ComponentModel.TypeConverter</AssemblyReference>
<AssemblyReference>System.Core</AssemblyReference>
<AssemblyReference>System.Data</AssemblyReference>
<AssemblyReference>System.Data.Common</AssemblyReference>
<AssemblyReference>System.Data.DataSetExtensions</AssemblyReference>
<AssemblyReference>System.Drawing</AssemblyReference>
<AssemblyReference>System.Drawing.Common</AssemblyReference>
<AssemblyReference>System.Drawing.Primitives</AssemblyReference>
<AssemblyReference>System.Linq</AssemblyReference>
<AssemblyReference>System.Net.Mail</AssemblyReference>
<AssemblyReference>System.ObjectModel</AssemblyReference>
<AssemblyReference>System.Private.CoreLib</AssemblyReference>
<AssemblyReference>System.Runtime.Serialization</AssemblyReference>
<AssemblyReference>System.ServiceModel</AssemblyReference>
<AssemblyReference>System.ServiceModel.Activities</AssemblyReference>
<AssemblyReference>System.Xaml</AssemblyReference>
<AssemblyReference>System.Xml</AssemblyReference>
<AssemblyReference>System.Xml.Linq</AssemblyReference>
<AssemblyReference>UiPath.System.Activities</AssemblyReference>
<AssemblyReference>UiPath.UiAutomation.Activities</AssemblyReference>
<AssemblyReference>UiPath.Studio.Constants</AssemblyReference>
<AssemblyReference>System.Configuration.ConfigurationManager</AssemblyReference>
<AssemblyReference>System.Security.Permissions</AssemblyReference>
<AssemblyReference>System.Console</AssemblyReference>
<AssemblyReference>System.ComponentModel</AssemblyReference>
<AssemblyReference>System.Memory</AssemblyReference>
<AssemblyReference>System.Private.Uri</AssemblyReference>
<AssemblyReference>System.Linq.Expressions</AssemblyReference>
<AssemblyReference>System.Runtime.Serialization.Formatters</AssemblyReference>
<AssemblyReference>System.Private.DataContractSerialization</AssemblyReference>
<AssemblyReference>System.Runtime.Serialization.Primitives</AssemblyReference>
</sco:Collection>
</TextExpression.ReferencesForImplementation>
<Sequence DisplayName="Main Sequence" sap:VirtualizedContainerService.HintSize="512,254.4" sap2010:WorkflowViewState.IdRef="Sequence_1">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<ui:LogMessage DisplayName="Log Message" sap:VirtualizedContainerService.HintSize="449.6,165.6" sap2010:WorkflowViewState.IdRef="LogMessage_1">
<ui:LogMessage.Message>
<InArgument x:TypeArguments="x:Object">
<CSharpValue x:TypeArguments="x:Object" sap2010:WorkflowViewState.IdRef="CSharpValue`1_1">"Hello World"</CSharpValue>
</InArgument>
</ui:LogMessage.Message>
</ui:LogMessage>
</Sequence>
</Activity>
Loading

0 comments on commit 43b9599

Please sign in to comment.