4
$\begingroup$

I write my whole package by using Mathematica front end, and I am currently in the process of writing the documentation using Workbench. I'm about 50% done, but realized I need to change the name of the package (and hence the name of the project).

Is this possible?

$\endgroup$
  • $\begingroup$ I tried once, it only changed the project folder's name, not the application nor the .m, .nb files. That was some time ago using the eclipse plugin. $\endgroup$ – b.gatessucks Nov 17 '14 at 13:08
4
+50
$\begingroup$

There are, at least, seven "names" related to this question that we usually want to be the same (or related), but in principle they could be different:

  1. name of Eclipse/Workbench project,
  2. name of directory in which project is contained,
  3. name of package file (or of "main" package file if it's bigger application with many *.m files),
  4. name of directory containing application (if it's not "one file" package),
  5. name of package context (or of "main" package context if application introduces many contexts or one context with sub-contexts),
  6. paclet name,
  7. first element of "documentation URI" for documentation pages introduced by application.

Unfortunately I don't know any "one click" way of changing all those names at once. I do it usually in three steps.

  • Right click on project and choose Rename... this takes care of point 1 and 2.

  • Manually rename main package file (point 3) and application directory (point 4)

  • Use Eclipse search/replace functionality.

    • From top menu choose Search > Search...,
    • in Containing text type in old package name,
    • select Case sensitive and Whole word,
    • in Scope choose Enclosing projects,
    • click Replace...
    • in With type in new package name,
    • click Ok (or Preview first to see and further customize changes).

    This should deal with points 5, 6 and 7.

I use Workbench as plug-in to Eclipse Luna. If you use different Eclipse version or standalone Workbench, then your interface might be slightly different.

After renaming make sure to rebuild documentation.

$\endgroup$
  • $\begingroup$ Thanks! Everything seems to work fine, and the project did rebuild without problems. $\endgroup$ – QuantumDot Nov 19 '14 at 11:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.