Hi
I wanted to import pharo into moose and I did MooseBrowser open
import pharo packages....
and then I realized that I must click one by one on each packages.
Is it correct?
Stef
Hi
two remarks
First - It seems strange that candidateClass is defined in ImportingTask
while only the MooseCompositeImporterTask use it and also define the
method run and doNotRun
=> so I pushed down these methods to the right place and the instance
variable too.
MooseImportClassesTask could not run the candidateOperator (it still
cannot).
Now MooseImportClassesTask does not import but just spit out classes
so this is ok and updated the class comments
to reflect that.
Second
you normally do not have to specify the CandidateListOperator
(this is only to switch between FAMIX2 and FAMIX3)
so do not use it
Similarly do not use importerClass: if you do not need it.
It is set by default in ImportingTask>>initialize (this is only
to switch between FAMIX2 and FAMIX3)
Do not do
model := MooseModel new.
importer := MooseSqueakClassPackageImporterTask new.
importer importingContext mergeClassAndMetaclass.
importer candidateClass: CandidateListOperator.
importer importerClass: SmalltalkImporter.
importer model: model; addFromPackagesNamed: packagesToImport; run.
MooseModel root add: model.
but
model := MooseModel new.
importer := MooseSqueakClassPackageImporterTask new.
importer importingContext mergeClassAndMetaclass.
importer model: model; addFromPackagesNamed: packagesToImport; run.
MooseModel root add: model.
Dear All,
Computing the number of lines of code is realized through:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
FAMIXBehavioralEntity>>numberOfLinesOfCode
<MSEProperty: #LOC type: #Number>
<property: #LOC longName: 'Lines of code' description:
'The number of lines of code in a method'>
^self
lookUpPropertyNamed: #LOC
computedAs:
[self mooseModel isSmalltalk
ifTrue:
[| parser |
parser := VisualWorksParseTreeMetricCalculator new.
parser processMethod: self usingImporter: nil inModel: nil.
parser numberOfLinesOfCode]
ifFalse: [-1]]
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
How to compute the number of lines of code with a C function?
How comes that this method is so closely related to Smalltalk ?
I am tempted to replace this method with something like:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
FAMIXBehavioralEntity>>numberOfLinesOfCode
<MSEProperty: #LOC type: #Number>
<property: #LOC longName: 'Lines of code' description:
'The number of lines of code in a method'>
^self
lookUpPropertyNamed: #LOC
computedAs:
[self source lineCount]
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Where source will be defined as:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
FAMIXBehavioralEntity>>source
^ self sourceAnchor source
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Any comments before I proceed?
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.