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

missing automation options #76

Closed
davidsanda opened this issue Jun 10, 2018 · 7 comments
Closed

missing automation options #76

davidsanda opened this issue Jun 10, 2018 · 7 comments
Milestone

Comments

@davidsanda
Copy link

It would be awesome, if the projects and options to configure them could be entered via command line to allow for greater automation.

@3F 3F added the enhancement label Jun 11, 2018
@3F
Copy link
Owner

3F commented Jun 11, 2018

Actually, I was already thinking about this through ~Install/Remove key: https://github.com/3F/DllExport/blob/master/Wizard/ActionType.cs#L42

So I will consider this later anyway, but I'm still not sure about elegant way to manage this.

The one of the problems is selecting specific projects. Don't forget, it may be 1, 2, 7, 20+ projects in one solution. Thus you should provide list of id or name or path, probably together with pattern via wildcards/regexp. Then we can provide options, but for example, lot of the same for two or more related projects, ughm ... we should also to think how to avoid this excess:

~

  • -Install {guid-1} {cfg_format}; {guid-2} {cfg_format}; {guid-3} {cfg_format}; ...
  • -Remove {guid-2}, {guid-3}

or it may be only through external file like -Install {cfg.xml}, or via some aggregation ~ {part_of_cfg1}:{guid-1},{guid-2};
need to think for different cases

So please also suggest your preferences.

@davidsanda
Copy link
Author

davidsanda commented Jun 11, 2018 via email

@3F
Copy link
Owner

3F commented Jun 11, 2018

@davidsanda, another important things that I forgot to say:

Neither the project name (I mean $(ProjectName)) nor the Guid ($(ProjectGuid)) cannot guarantee anything because it's optional properties at all.

Therefore, by default (without user's actions) only relative path to project file (.csproj, .vcxproj, ...) is an unique 'ident'. We can also use the Guid number from .sln definition, but this is another value and story at all.

This is official/original internal logic in MS libraries when VS or msbuild works with any projects (searching, loading, parsing, etc). MvsSln follows this rules with some additions, but anyway ...

So basically, seems like, we need to implement list only via relative path to project files. Please do not hesitate to comment if someone may have some problems for this way.

@3F
Copy link
Owner

3F commented Jun 11, 2018

/draft

option 1 - *only through configuration file

  • -Install mycfg.xml
    • only through file - means that we'll not reserve some place for future console commands like -Install path_to_project_file {...} or for any its subcommands-Install -project path_to_project_file {...}
  • Same format as for .net.dllexport.targets file - Implementation of the external .net.dllexport configuration file #49 (comment)
  • This also supports properties by default and properties for specific projects:
...
<PropertyGroup Label="Default values to all other unspecified projects">
  <DllExportNamespace>System.Runtime.InteropServices</DllExportNamespace>
  <PlatformTarget>x86</PlatformTarget>
  <DllExportOrdinalsBase>1</DllExportOrdinalsBase>
</PropertyGroup>
<PropertyGroup Condition="..." Label="Specific option only for ClassLibrary2\ClassLibrary2.csproj">
  <DllExportNamespace>net.r_eg.DllExport</DllExportNamespace>
  <DllExportDDNSCecil>false</DllExportDDNSCecil>
  <PlatformTarget>x64</PlatformTarget>
  <DllExportOrdinalsBase>0</DllExportOrdinalsBase>
  <DllExportGenExpLib>false</DllExportGenExpLib>
  <DllExportOurILAsm>false</DllExportOurILAsm>
  <DllExportLeaveIntermediateFiles>true</DllExportLeaveIntermediateFiles>
  <DllExportTimeout>60000</DllExportTimeout>
  <DllExportSkipOnAnyCpu>false</DllExportSkipOnAnyCpu>
  <DllExportILAsmCustomPath>$(SolutionDir)bin\</DllExportILAsmCustomPath>
</PropertyGroup>
<PropertyGroup Condition="..." Label="Use default values for ClassLibrary4.csproj from global section" />
...
  • The identifiers should be exactly as an relative path to project files.
  • Support of wildcards or regex in identifiers.
  • Easy to implement because of similar logic as for mentioned .net.dllexport.targets
  • -Remove mycfg.xml vice versa.

option 2 - under .net.dllexport.targets

Basically we already have optional external configuration file. Thus we can try to combine this file for both purposes:

  • Extend its identifier with an relative path in addition to Guid. See Label attr.
  • Implement updating project files for Install, Remove keys.
  • Allow global/default properties. Or how about just to configure it once via GUI.

@davidsanda
Copy link
Author

davidsanda commented Jun 12, 2018 via email

@3F
Copy link
Owner

3F commented Jun 12, 2018 via email

@3F 3F added this to the v1.6.1 milestone Jul 14, 2018
3F added a commit that referenced this issue Jul 30, 2018
@3F
Copy link
Owner

3F commented Jul 30, 2018

David, I implemented features for additional automation via new actions:

  • -action Export - To export configured projects data.
  • -action Recover - To re-configure projects via predefined/exported data.
  • -action Unset - To unset all data from specified projects.

For all cases will be used same .net.dllexport.targets file inside solution directory as for -action Configure with external storage.
So it can be easily configured and distributed beyond project files.

I implemented exactly Recover & Unset keys because it still uses .net.dllexport.targets as an external storage.
Therefore, you can also recover broken/avoided references with projects in the same manner as their removing without affecting on .net.dllexport.targets

For example:

DllExport -action Unset

Now your projects has been cleaned from our tool. But .net.dllexport.targets still is available for something.

DllExport -action Recover

Will recover one or more missed references from this file. For non-configured solution you can consider it as an Import feature.

But some note:

  • Before using -action Recover, you need, either configure it again via -action Configure to update new format of this file or command -action Export that will replace old data. The required data is already presented in the old file, but I don't want to complicate the logic.

Check this out. 662cb35 / build-90

I'll plan to release public 1.6.1 after #59. Hope for today, or tomorrow :)

@3F 3F closed this as completed Jul 30, 2018
3F added a commit that referenced this issue Aug 5, 2018
* FIXED: Fixed bug when some methods cannot be exported. Issue #59.
* FIXED: Bug 'The node is not parented by this object' when Configuring projects. Issue: #77.
* FIXED: Fixed GDI objects leak in Wizard.
* FIXED: `-msb` key cannot affect for GetNuTool section. Issue #74.
* FIXED: Bug when automatic restoring still uses default keys from manager after configuring with custom `-server`.
* FIXED: Problem with double quotes for `-packages` key.
* FIXED: Possible incorrect repetition of the relative path for `-packages` key.
* FIXED: Possible problem 'The request was aborted: Could not create SSL/TLS secure channel.'. Issue: #77.
* FIXED: Possible problem with path when `-msb` key contains round brackets,
         e.g.: `D:\C\Program Files (x86)\Microsoft Visual Studio\`...

* NEW: Implemented features for additional automation. Issue #76.
        New actions:
            * `-action Export`
            * `-action Recover`
            * `-action Unset`

        Documentation: https://github.com/3F/DllExport/wiki/DllExport-Manager#automation

* NEW: Added proxy support for manager.
        The common format: `[usr[:pwd]@]host[:port]`

        Documentation: https://github.com/3F/DllExport/wiki/DllExport-Manager#proxy

* NEW: Wizard. Added sorting an projects in main window by its installing status and by availability.
* NEW: Wizard. Added filter for list of projects in main wizard window.
* NEW: New 'Offline' versions from our packages. See GitHub Releases page.
* NEW: Added key to force update `Reference` without PublicKeyToken. Issue #65.
* NEW: Added `-force` key for manager to use aggressive behavior, e.g. like removing pkg when updating.
       Wiki: https://github.com/3F/DllExport/wiki/DllExport-Manager#receiving-new-package-version

* NEW: New action `-action Upgrade`.
       Aggregates an Update action with additions for upgrading.

            Today's an Upgrade action:
            ```
            DllExport -action Upgrade ...
            ```

            is equal to:
            ```
            DllExport -action Update -mgr-up -force ...
            ```

            Wiki: https://github.com/3F/DllExport/wiki/DllExport-Manager#updating

* CHANGED: Case sensitivity for the Action names.
* CHANGED: `-action Default` for nothing.
* CHANGED: UI layout fixes for -Info form (Thanks @Genteure, Issue #61).
* CHANGED: Allows absolute path for `-packages` key.
* CHANGED: `-sln-file` key now can affect to `-action Configure`
* CHANGED: hMSBuild tool now is also distributed inside root directory of the packages zip & nupkg.
           Use this for EXP0014 problem: "RunIlAsm. The library manager still cannot be found."
           Example: https://www.youtube.com/watch?v=zUejJ4vUPGw

* CHANGED: Updated GetNuTool v1.6.2
* CHANGED: Updated MvsSln v2.1.0
* OTHER: Some other fixes and changes with manager and wizard.
* NOTE: To upgrade configured version: `DllExport -action Upgrade ...`
* NOTE: Configuring projects: `DllExport -action Configure ...`
* NOTE: Screencasts:
            * Quick start: https://www.youtube.com/watch?v=sBWt-KdQtoc
            * Basic examples for C++ and C#: https://www.youtube.com/watch?v=9Hyg3_WE9Ks
            * Complex types and Strings: https://www.youtube.com/watch?v=QXMj9-8XJnY

* NOTE: Our actual wiki - https://github.com/3F/DllExport/wiki
        * Documentation for manager: https://github.com/3F/DllExport/wiki/DllExport-Manager
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants