Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve importers API #789

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Moose-Importers/FamixAbstractFileImporter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Class {
'model',
'inputStream'
],
#category : #'Moose-Importers'
#category : #'Moose-Importers-FromPersistedFiles'
}

{ #category : #testing }
Expand Down
2 changes: 1 addition & 1 deletion src/Moose-Importers/FamixJSONFileImporter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Importer for JSON file
Class {
#name : #FamixJSONFileImporter,
#superclass : #FamixAbstractFileImporter,
#category : #'Moose-Importers'
#category : #'Moose-Importers-FromPersistedFiles'
}

{ #category : #executing }
Expand Down
51 changes: 43 additions & 8 deletions src/Moose-Importers/FamixJavaFoldersImporter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ Class {
#name : #FamixJavaFoldersImporter,
#superclass : #Object,
#instVars : [
'folders'
'folders',
'models'
],
#classVars : [
'VerveineJPath'
],
#category : #'Moose-Importers'
#category : #'Moose-Importers-ParseFolders'
}

{ #category : #accessing }
Expand All @@ -39,13 +40,23 @@ FamixJavaFoldersImporter class >> defaultVerveineJDirectory [
]

{ #category : #actions }
FamixJavaFoldersImporter class >> importFolder: aFileReference [
FamixJavaFoldersImporter class >> importAndInstallFolder: aFileReference [

^ self importFolders: { aFileReference }
^ self importAndInstallFolders: { aFileReference }
]

{ #category : #actions }
FamixJavaFoldersImporter class >> importAndInstallFolders: aCollection [
"I'll parse, import in a moose model and install the models for each folder in the collection."

^ self new
folders: aCollection;
importAndInstall
]

{ #category : #actions }
FamixJavaFoldersImporter class >> importFolders: aCollection [
"I'll parse and import in a moose model for each folder in the collection."

^ self new
folders: aCollection;
Expand Down Expand Up @@ -124,7 +135,19 @@ FamixJavaFoldersImporter >> import [

self generateJsonOfProjects.

self importModels
self importModels.

^ models
]

{ #category : #actions }
FamixJavaFoldersImporter >> importAndInstall [

self import.

self installModels.

^ models
]

{ #category : #actions }
Expand All @@ -143,12 +166,24 @@ FamixJavaFoldersImporter >> importModels [
inputFile: json;
run.

model
name: folder basename;
install ]
model name: folder basename.
models add: model ]
displayingProgress: [ :folder | folder basename ]
]

{ #category : #initialization }
FamixJavaFoldersImporter >> initialize [

super initialize.
models := OrderedCollection new
]

{ #category : #actions }
FamixJavaFoldersImporter >> installModels [

models do: [ :model | model install ]
]

{ #category : #actions }
FamixJavaFoldersImporter >> jsonForFolder: folder [

Expand Down
2 changes: 1 addition & 1 deletion src/Moose-Importers/FamixMSEFileImporter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Importer for MSE files
Class {
#name : #FamixMSEFileImporter,
#superclass : #FamixAbstractFileImporter,
#category : #'Moose-Importers'
#category : #'Moose-Importers-FromPersistedFiles'
}

{ #category : #executing }
Expand Down
2 changes: 1 addition & 1 deletion src/Moose-Importers/MooseFileStructureImporter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Class {
'mooseModel',
'factory'
],
#category : #'Moose-Importers-Importers'
#category : #'Moose-Importers-FileSystem'
}

{ #category : #accessing }
Expand Down
Loading