Giter Site home page Giter Site logo

xor-el / autosuffix Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rvelthuis/autosuffix

0.0 1.0 1.0 27 KB

Package that adds context menu item to project manager to set or update the lib suffix for the current version.

License: BSD 2-Clause "Simplified" License

Pascal 100.00%

autosuffix's Introduction

AutoSuffix

If you must maintain one package for several different versions of Delphi, then the usual way is to have a new project for each version with a different {$LIBSUFFIX } for the current version, i.e. for Tokyo, the lib suffix is 250, for Berlin it is 240, etc.

It would be ideal, if we could have a {$LIBSUFFIX AUTO}, so we could have a single package source and the IDE would add an appropriate suffix. I tried using an include file with something like:

{$IFDEF VER320} {$LIBSUFFIX '250'} {$ENDIF}

and so on, and put that in the package source, but any change to the package would make the IDE remove that and use the suffix (if any) it found in the .dproj file. If I put it back in, the compiled package (let's call it MyPackage.dpk) would indeed have that suffix (i.e. be compiled to MyPackage250.bpl), but the IDE was not aware of that, and would complain it could not install MyPackage.bpl.

This problem is not new. It has been discussed various times on several forums and communities. On Stack Overflow, someone (called LaKraven) set out to create a wizard to solve this, but it can't be found anymore. All the websites that supposedly have it are up for grabs.

So I (re-)wrote this simple wizard myself. It adds a menu item to the project manager, with the title "Add Version Suffix", under the "Rename" context menu item. This allows you to set the lib suffix for a package to the suffix that is generally used for this version, so '250' for Tokyo, '240' for Berlin, etc.

Actually, this could be done automatically too, but not everyone wants that for every package, so now you have to change the suffix manually.

Tested

I only tested this in Delphi 10 Seattle, 10.1 Berlin and 10.2 Tokyo, but it probably works in older versions as well.

Installation

Just open the package AutoSuffix.dproj in your IDE, select the project in the Project Manager and Select the Install menu item from the context menu. If all is well, this installs the expert and adds one menu item to the context menu of the Project Manager: Add Version Suffix, under the Rename item. This menu item only appears if the project is a package.

Files

File Contents
.gitignore Git ignores the files in this file
AddAutoSuffixProjectMenu.pas The main wizard that adds the menu item and sets the suffix
AutoSuffix.dpk The compiler project file
AutoSuffix.dproj The MSBUILD project file
AutoSuffix.res The resource file for this project
LICENSE.md The BSD two clause license for this project
OpenTools.LocalMenus.pas A stub implementation for IOTALocalMenu
README.md The readme for this project

autosuffix's People

Contributors

rvelthuis avatar

Watchers

 avatar

Forkers

gitcontainer

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.