Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Packages » howto duplicate main package and rename classes "in bulk"?
howto duplicate main package and rename classes "in bulk"? [message #237] Mon, 05 December 2005 09:23 Go to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
howto duplicate main package and rename classes "in bulk"?
Re: howto duplicate main package and rename classes "in bulk"? [message #243 is a reply to message #237] Mon, 05 December 2005 10:04 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
fudadmin wrote on Mon, 05 December 2005 03:23

howto duplicate main package and rename classes "in bulk"?


No direct support. You can "clone" package by copying its folder and renaming ".upp" file (.upp file contans the package information and must much the name of directory).

To rename classes, use Find in files.
Re: howto duplicate main package and rename classes "in bulk"? [message #269 is a reply to message #243] Mon, 05 December 2005 16:32 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
luzr wrote on Mon, 05 December 2005 04:04

fudadmin wrote on Mon, 05 December 2005 03:23

howto duplicate main package and rename classes "in bulk"?


No direct support. You can "clone" package by copying its folder and renaming ".upp" file (.upp file contans the package information and must much the name of directory).

To rename classes, use Find in files.


Thank you! That's great!

Now I have Aris versioning system Cool :

1. Preparation - performed once:
1.1. Create your working dir e.g "uppMyWork" (paralell with upp).
1.2. Make a copy of "MyApps.var" (file in "upp" dir) and Rename to e.g "MyProject1.var"
1.3. Edit inside e.g "MyProject1.var" (e.g with Notepad) to have the correct dirs.
(That should enough to show "MyProject1" in Assembly column of package dialogue)

2. Every time you want - a new Project(assembly?):
2.1. Make a copy of any existing "*.var" to e.g "MyProject2.var"
2.2. Edit inside e.g "MyProject2.var" (e.g with Notepad) to have the correct dirs.

3. Every time you want - a new Versions of a project:
3.1. Copy and Rename a subdir with inside files e.g. "MyProject1" (in e.g "uppMyWork") to "MyProject2" and
3.2. Rename "MyProject1.upp" file inside the subdir to "MyProject2.upp"

Does it breach any Myrek's good rules Smile ?

[Updated on: Mon, 05 December 2005 18:01]

Report message to a moderator

Re: howto duplicate main package and rename classes "in bulk"? [message #270 is a reply to message #269] Mon, 05 December 2005 17:38 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
fudadmin wrote on Mon, 05 December 2005 10:32

luzr wrote on Mon, 05 December 2005 04:04

fudadmin wrote on Mon, 05 December 2005 03:23

howto duplicate main package and rename classes "in bulk"?


No direct support. You can "clone" package by copying its folder and renaming ".upp" file (.upp file contans the package information and must much the name of directory).

To rename classes, use Find in files.


Thank you! That's great!

Now I have Aris versioning system Cool :

1. Preparation - performed once:
1.1. Create your working dir e.g "uppMyWork" (paralell with upp).
1.2. Make a copy of "MyApps.var" (file in "upp" dir) and Rename to e.g "MyProject1.var"
1.3. Edit inside e.g "MyProject1.var" (e.g with Notepad) to have the correct dirs.
(That should enough to show "MyProject1" in Assembly column of package dialogue)

2. Every time you want - a new Project(assembly?):
2.1. Make a copy of any existing "*.var" to e.g "MyProject2.var" 2.2. Edit inside e.g "MyProject2.var" (e.g with Notepad) to have the correct dirs.

3. Every time you want - a new Versions of a project:
3.1. Copy and Rename a subdir with inside files e.g. "MyProject1" (in e.g "uppMyWork") to "MyProject2" and
3.2. Rename "MyProject1.upp" file inside the subdir to "MyProject2.upp"

Does it breach any Myrek's good rules Smile ?



Well, just keep in mind that you can have more main packages - projects in single nest. So perhaps "MyProjects" would work too... (as does MyApps...).

[Updated on: Mon, 05 December 2005 17:58] by Moderator

Report message to a moderator

Re: howto duplicate main package and rename classes "in bulk"? [message #271 is a reply to message #270] Mon, 05 December 2005 18:10 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
luzr wrote on Mon, 05 December 2005 11:38



Well, just keep in mind that you can have more main packages - projects in single nest. So perhaps "MyProjects" would work too... (as does MyApps...).


BTW, I tried to achieve the same "one level deeper" - in MyApps, but, for the "unknown reasons" Smile , it didn't work... Maybe, I did something wrong. Could anyone post the detailed instructions?

But, in fact I'd prefer that kind of feature to have from TheIDE...
Re: howto duplicate main package and rename classes "in bulk"? [message #272 is a reply to message #271] Mon, 05 December 2005 18:37 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
fudadmin wrote on Mon, 05 December 2005 12:10

luzr wrote on Mon, 05 December 2005 11:38



Well, just keep in mind that you can have more main packages - projects in single nest. So perhaps "MyProjects" would work too... (as does MyApps...).


BTW, I tried to achieve the same "one level deeper" - in MyApps, but, for the "unknown reasons" Smile , it didn't work... Maybe, I did something wrong. Could anyone post the detailed instructions?

But, in fact I'd prefer that kind of feature to have from TheIDE...


Well, thinking about it, if the purpose is "versioning", that your solution is weird, but working Smile

However, I recommend using versioning system. Either uvs2 or anything else. What you describe can be good when you are about to refactor large portions of code, thought...
Re: howto duplicate main package and rename classes "in bulk"? [message #2696 is a reply to message #270] Fri, 21 April 2006 21:45 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1182
Registered: March 2006
Location: Italy
Senior Contributor
luzr wrote on Mon, 05 December 2005 17:38

fudadmin wrote on Mon, 05 December 2005 10:32

luzr wrote on Mon, 05 December 2005 04:04

fudadmin wrote on Mon, 05 December 2005 03:23

howto duplicate main package and rename classes "in bulk"?


No direct support. You can "clone" package by copying its folder and renaming ".upp" file (.upp file contans the package information and must much the name of directory).

To rename classes, use Find in files.


Thank you! That's great!

Now I have Aris versioning system Cool :

1. Preparation - performed once:
1.1. Create your working dir e.g "uppMyWork" (paralell with upp).
1.2. Make a copy of "MyApps.var" (file in "upp" dir) and Rename to e.g "MyProject1.var"
1.3. Edit inside e.g "MyProject1.var" (e.g with Notepad) to have the correct dirs.
(That should enough to show "MyProject1" in Assembly column of package dialogue)

2. Every time you want - a new Project(assembly?):
2.1. Make a copy of any existing "*.var" to e.g "MyProject2.var" 2.2. Edit inside e.g "MyProject2.var" (e.g with Notepad) to have the correct dirs.

3. Every time you want - a new Versions of a project:
3.1. Copy and Rename a subdir with inside files e.g. "MyProject1" (in e.g "uppMyWork") to "MyProject2" and
3.2. Rename "MyProject1.upp" file inside the subdir to "MyProject2.upp"

Does it breach any Myrek's good rules Smile ?



Well, just keep in mind that you can have more main packages - projects in single nest. So perhaps "MyProjects" would work too... (as does MyApps...).


I'm quoting an old post. Perhaps the solution changed since it.
I've a similar problem. My project is growing quickly and some time I want to work on a new version freezing the old.
Unfotunately copy and past of the folder package and renaming the upp file is not enough. In fact I use *lay and *iml file that depend by the package directory. So each time I must rename all the include.
Does exist a lazy way to do a copy of a package?

Luigi

PS: in my package I don't see any *.var file.
Re: howto duplicate main package and rename classes "in bulk"? [message #2699 is a reply to message #2696] Sat, 22 April 2006 00:37 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
*.var files live in your main upp dir where theide.exe lives.
But now (I think...) you can create a new var with right click in the left pane after ide start:
"Create a new assembly". Then, fill in some dirs.

[Updated on: Sat, 22 April 2006 00:37]

Report message to a moderator

Re: howto duplicate main package and rename classes "in bulk"? [message #2701 is a reply to message #2696] Sat, 22 April 2006 01:31 Go to previous messageGo to next message
gprentice is currently offline  gprentice
Messages: 260
Registered: November 2005
Location: New Zealand
Experienced Member
forlano wrote on Sat, 22 April 2006 07:45

luzr wrote on Mon, 05 December 2005 17:38

fudadmin wrote on Mon, 05 December 2005 10:32

luzr wrote on Mon, 05 December 2005 04:04

fudadmin wrote on Mon, 05 December 2005 03:23

howto duplicate main package and rename classes "in bulk"?


No direct support. You can "clone" package by copying its folder and renaming ".upp" file (.upp file contans the package information and must much the name of directory).

To rename classes, use Find in files.


Thank you! That's great!

Now I have Aris versioning system Cool :

1. Preparation - performed once:
1.1. Create your working dir e.g "uppMyWork" (paralell with upp).
1.2. Make a copy of "MyApps.var" (file in "upp" dir) and Rename to e.g "MyProject1.var"
1.3. Edit inside e.g "MyProject1.var" (e.g with Notepad) to have the correct dirs.
(That should enough to show "MyProject1" in Assembly column of package dialogue)

2. Every time you want - a new Project(assembly?):
2.1. Make a copy of any existing "*.var" to e.g "MyProject2.var" 2.2. Edit inside e.g "MyProject2.var" (e.g with Notepad) to have the correct dirs.

3. Every time you want - a new Versions of a project:
3.1. Copy and Rename a subdir with inside files e.g. "MyProject1" (in e.g "uppMyWork") to "MyProject2" and
3.2. Rename "MyProject1.upp" file inside the subdir to "MyProject2.upp"

Does it breach any Myrek's good rules Smile ?



Well, just keep in mind that you can have more main packages - projects in single nest. So perhaps "MyProjects" would work too... (as does MyApps...).


I'm quoting an old post. Perhaps the solution changed since it.
I've a similar problem. My project is growing quickly and some time I want to work on a new version freezing the old.
Unfotunately copy and past of the folder package and renaming the upp file is not enough. In fact I use *lay and *iml file that depend by the package directory. So each time I must rename all the include.
Does exist a lazy way to do a copy of a package?

Luigi

PS: in my package I don't see any *.var file.



U++ is designed to make copying and distribution of a package very easy. If you have an existing package PKG1 in a folder called NEST1, to copy/replicate the package in another folder, say NEST2, just copy the PKG1 folder (and all its content) to the NEST2 folder. Create a new assembly, say Assembly2, and add the NEST2 path to the assembly nests path list - so the nest paths might then look something like
L:\Projects\Upp\NEST2;L:\Apps\upp604Dev3\uppsrc
After you copy the PKG1 folder into NEST2 and create the assembly you should see the PKG1 package in the list of packages for the NEST2 assembly.

Inside the package, all path information normally starts with a package name e.g. PKG1 and the nest path setting in the assembly determines where PKG1 is looked for. *.iml and .lay files don't have path information in them (I believe) so should be no problem.

If you have used explicit path information in your source files
e.g. #include L:\xyz\something.cpp
then you have more work to do if you want something.cpp to be not shared between PKG1 and PKG2. Most of the time, your #includes either have no path information in them at all, or the path starts with a package name.
e.g. with #include <CtrlLib/CtrlLib.h>
CtrlLib is a package name and U++ will try to locate a folder of that name in one of the nest paths of the assembly.

Try reading "packages, assemblies and nests" in the help - click on "help index" in theIDE. I could add a section called "copying a package" to it but I have a feeling nobody is reading it ...

Graeme
Re: howto duplicate main package and rename classes "in bulk"? [message #2702 is a reply to message #2699] Sat, 22 April 2006 02:03 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
fudadmin wrote on Fri, 21 April 2006 23:37

*.var files live in your main upp dir where theide.exe lives.
But now (I think...) you can create a new var with right click in the left pane after ide start:
"Create a new assembly". Then, fill in some dirs.

Also, you can open *.var files as text, study the syntax (easy) and create, and edit them "by hand".
For myself, I've made ("nearly finished"... Smile) my vars and packages and templates manager... If I find some more inspiration to finish it, I'll post it.

[Updated on: Sat, 22 April 2006 05:42]

Report message to a moderator

Re: howto duplicate main package and rename classes "in bulk"? [message #2703 is a reply to message #2696] Sat, 22 April 2006 05:40 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
Quote:


Unfotunately copy and past of the folder package and renaming the upp file is not enough. In fact I use *lay and *iml file that depend by the package directory. So each time I must rename all the include.
Does exist a lazy way to do a copy of a package?


Yes, it does. Not the laziest but as I described. In that case, (as I remember, only for at least MSC71 (and without spaghetto...))- use only quotes (e.g "Vega.lay", "Vega.iml") .
Then you can rename and move packages freely (within *.var dirs!). With the only 1 extra step - don't forget renaming "Vega1.upp" "in synchro" (the same) with package folder e.g "Vega1". That's it! Laughing

P.S You don't need extra *.var files if this works for you.

[Updated on: Sat, 22 April 2006 05:51]

Report message to a moderator

Re: howto duplicate main package and rename classes "in bulk"? [message #2704 is a reply to message #2703] Sat, 22 April 2006 06:10 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
fudadmin wrote on Sat, 22 April 2006 04:40

Quote:


Unfotunately copy and past of the folder package and renaming the upp file is not enough. In fact I use *lay and *iml file that depend by the package directory. So each time I must rename all the include.
Does exist a lazy way to do a copy of a package?


Yes, it does. Not the laziest but as I described. In that case, (as I remember, only for at least MSC71 (and without spaghetto...))- use only quotes (e.g "Vega.lay", "Vega.iml") .
Then you can rename and move packages freely (within *.var dirs!). With the only 1 extra step - don't forget renaming "Vega1.upp" "in synchro" (the same) with package folder e.g "Vega1". That's it! Laughing

P.S You don't need extra *.var files if this works for you.


to trick MINGW:
#define PACKAGEDIR <ForlanoVega1

//..........
#include PACKAGEDIR/OptionImage.h>
#include PACKAGEDIR/TwoCtrl.h>
//etc.

Smile
Then the one more extra step - you need to correct:
#define PACKAGEDIR <ForlanoVega1
but you can use it for versioning!

[Updated on: Sat, 22 April 2006 06:17]

Report message to a moderator

Re: howto duplicate main package and rename classes "in bulk"? [message #2705 is a reply to message #2704] Sat, 22 April 2006 09:21 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
The trick:
#define PACKAGEDIR <ForlanoVega1

doesn't work correctly with at least optimal modes and BLITZ.
Does anybody know the reason?

[Updated on: Sat, 22 April 2006 09:22]

Report message to a moderator

Re: howto duplicate main package and rename classes "in bulk"? [message #2706 is a reply to message #2705] Sat, 22 April 2006 10:02 Go to previous messageGo to next message
gprentice is currently offline  gprentice
Messages: 260
Registered: November 2005
Location: New Zealand
Experienced Member
fudadmin wrote on Sat, 22 April 2006 19:21

The trick:
#define PACKAGEDIR <ForlanoVega1

doesn't work correctly with at least optimal modes and BLITZ.
Does anybody know the reason?



The mechanism for substitution of names within a #include statement is "implementation defined" and the usual guideline is to not do what you are doing, but to do something like

#define SF <dir/file.h>
#include SF

where the text that follows the #include is a single name, the name of a macro.

Graeme
Re: howto duplicate main package and rename classes "in bulk"? [message #2707 is a reply to message #2706] Sat, 22 April 2006 10:13 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
gprentice wrote on Sat, 22 April 2006 09:02

fudadmin wrote on Sat, 22 April 2006 19:21

The trick:
#define PACKAGEDIR <ForlanoVega1

doesn't work correctly with at least optimal modes and BLITZ.
Does anybody know the reason?



The mechanism for substitution of names within a #include statement is "implementation defined" and the usual guideline is to not do what you are doing, but to do something like

#define SF <dir/file.h>
#include SF

where the text that follows the #include is a single name, the name of a macro.

Graeme


Thanks! I had a feeling that a was breaking something. Have you got an idea how to implement this with a macro? Or what would be the best?
Re: howto duplicate main package and rename classes "in bulk"? [message #2708 is a reply to message #2707] Sat, 22 April 2006 10:42 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1182
Registered: March 2006
Location: Italy
Senior Contributor
fudadmin wrote on Sat, 22 April 2006 10:13

gprentice wrote on Sat, 22 April 2006 09:02

fudadmin wrote on Sat, 22 April 2006 19:21

The trick:
#define PACKAGEDIR <ForlanoVega1

doesn't work correctly with at least optimal modes and BLITZ.
Does anybody know the reason?


The mechanism for substitution of names within a #include statement is "implementation defined" and the usual guideline is to not do what you are doing, but to do something like

#define SF <dir/file.h>
#include SF

where the text that follows the #include is a single name, the name of a macro.

Graeme


Thanks! I had a feeling that a was breaking something. Have you got an idea how to implement this with a macro? Or what would be the best?


I tried the above trick with MINGW and it works. In this way copy, past the package folder and rename the .upp file seems the shortest way to replicate a package.
I miss in TheIDE a menu item like "Save Package as...".
Luigi
Re: howto duplicate main package and rename classes "in bulk"? [message #2709 is a reply to message #2708] Sat, 22 April 2006 10:59 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
Luigi, do you mean "paste" or "pasta"? Laughing

[Updated on: Sat, 22 April 2006 11:00]

Report message to a moderator

Re: howto duplicate main package and rename classes "in bulk"? [message #2710 is a reply to message #2709] Sat, 22 April 2006 11:10 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1182
Registered: March 2006
Location: Italy
Senior Contributor
fudadmin wrote on Sat, 22 April 2006 10:59

Luigi, do you mean "paste" or "pasta"? Laughing


Maybe "pasta" because above you cited the "spaghetto" Smile
Re: howto duplicate main package and rename classes "in bulk"? [message #2711 is a reply to message #2705] Sat, 22 April 2006 11:23 Go to previous messageGo to next message
gprentice is currently offline  gprentice
Messages: 260
Registered: November 2005
Location: New Zealand
Experienced Member
fudadmin wrote on Sat, 22 April 2006 19:21

The trick:
#define PACKAGEDIR <ForlanoVega1

doesn't work correctly with at least optimal modes and BLITZ.
Does anybody know the reason?



I did a quick test using VC7.1 and GCC 3.4 and this "trick" seems to work with both, but I did it outside of U++. Did you try turning off Blitz? (I haven't caught up with what Blitz does yet).

According to the standard I think what you're doing should work but I'm fairly sure it doesn't work with at least the Borland compiler - which doesn't matter here. The bit that's implementation defined is how the tokens between the <> or the "" are interpreted, so as far as I can see, the string folowing the #include should be substituted and re-substituted at least until it has <> and ""

http://gcc.gnu.org/onlinedocs/cpp/Computed-Includes.html#Com puted-Includes

I believe one thing to watch out for is the possibility that
#define QUOTE "
might be rejected by a compiler because " by itself is not a valid token - it requires two " to be valid - I'm not entirely sure about this though.

Also the difference between <> and "" with U++ supported compilers is that use of <> means the "current" directory isn't looked in, but with "" it is.

Graeme
Re: howto duplicate main package and rename classes "in bulk"? [message #2712 is a reply to message #2708] Sat, 22 April 2006 11:35 Go to previous messageGo to previous message
gprentice is currently offline  gprentice
Messages: 260
Registered: November 2005
Location: New Zealand
Experienced Member
forlano wrote on Sat, 22 April 2006 20:42

I tried the above trick with MINGW and it works. In this way copy, past the package folder and rename the .upp file seems the shortest way to replicate a package.
I miss in TheIDE a menu item like "Save Package as...".
Luigi



Well ... not sure if you read my post but I would have thought the easiest thing was to do it the "standard" U++ way. Why do you need a macro name in the #include ? If it's just for package replication, I suspect it's not the easiest way nor the cleanest.

I doubt if it would be viable for "save package as" to go and change your #includes for you. BTW - you don't need to qualify a filename in a #include if it's in the same directory as the including file (in case you didn't know).

Graeme
Previous Topic: Link error when building ide\Debuggers module? [SOLVED] -not main package
Next Topic: Bug
Goto Forum:
  


Current Time: Thu Mar 28 20:27:31 CET 2024

Total time taken to generate the page: 0.01740 seconds