#FEATURE by cg
authorClaus Gittinger <cg@exept.de>
Wed, 15 Feb 2017 16:56:24 +0100
changeset 21449 fab3dc7eb9be
parent 21448 59c38b4d195a
child 21450 0f7f5f090f81
#FEATURE by cg class: ProjectDefinition added: #projectTags #superProject
ProjectDefinition.st
--- a/ProjectDefinition.st	Tue Feb 14 22:13:00 2017 +0100
+++ b/ProjectDefinition.st	Wed Feb 15 16:56:24 2017 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 2006 by eXept Software AG
               All Rights Reserved
@@ -833,6 +831,17 @@
     ].
 !
 
+projectTags
+    "a list of resource-tags used in the project.
+     These are offered in the browser's methodList menu as 'Tag as' items.
+     Allowing convenient tagging for things like '<resource: EXPECCO_API>'.
+     When redefined, a collection of useful tag-strings should be returned."
+     
+    ^ #()
+
+    "Created: / 15-02-2017 / 16:42:48 / cg"
+!
+
 topRelativePathTo:aBaseFilename inPackage:aPackageID architecture:arch
     "Returns the path to stx counting the number of $/ and $: in the package name
      and adding for each one '../' to get the ST/X top directory"
@@ -2305,6 +2314,38 @@
     ^ #()
 
     "Modified: / 17-08-2006 / 19:57:46 / cg"
+!
+
+superProject
+    "return the package which contains me as subProject,
+     or if not found, which contains me under its directory hierarchy,
+     or nil if none found"
+
+    |p superPackage idx|
+    
+    ProjectDefinition allSubclassesDo:[:prjDef |
+        (prjDef subProjects includes:package) ifTrue:[^ prjDef].
+    ].
+    p := package.
+    [
+        (idx := p lastIndexOf:$/) ~~ 0 
+    ] whileTrue:[
+        |defClass|
+        
+        superPackage := p copyTo:idx-1.
+        (defClass := ProjectDefinition definitionClassForPackage:superPackage) notNil ifTrue:[
+            ^ defClass
+        ].
+        p := superPackage.
+    ].    
+    ^ nil
+
+    "
+     stx_goodies_refactoryBrowser_lint superProject 
+     exept_expecco_plugin_guiBrowser superProject 
+    "
+
+    "Created: / 15-02-2017 / 16:49:05 / cg"
 ! !
 
 !ProjectDefinition class methodsFor:'description - actions'!