Permalink
Browse files

AS3 codegen: Provided the api and model package names to LibraryRefer…

…ences object to make sure classes are located
  • Loading branch information...
deepak-michael committed Dec 16, 2011
1 parent 20d0da1 commit 0dda2fdfe6d63cd96a01c369d18f52f9446762bb
@@ -6,7 +6,7 @@ package com.wordnik.swagger.common
import com.wordnik.swagger.event.ApiClientEvent;
import com.wordnik.swagger.event.Response;
import com.wordnik.swagger.common.ApiUserCredentials;
- import com.wordnik.swagger.model.LibraryReferences;
+ import com.wordnik.swagger.common.LibraryReferences;
import flash.events.EventDispatcher;
import flash.utils.Dictionary;
@@ -1,6 +1,7 @@
-package $packageName$ {
+package com.wordnik.swagger.common {
-import com.wordnik.swagger.api.*;
+import $apiPackageName$.*;
+import $modelPackageName$.*;
$imports:{ import |
import $import$;
@@ -139,8 +139,10 @@ private void generateReferencesObject(List<Resource> resources, StringTemplateGr
template.setAttribute("annotationPackageName", languageConfig.getAnnotationPackageName());
template.setAttribute("extends", config.getDefaultModelBaseClass());
template.setAttribute("className", referencesModel.getGenratedClassName());
- template.setAttribute(PACKAGE_NAME, config.getModelPackageName());
- File aFile = new File(languageConfig.getModelClassLocation()+referencesModel.getGenratedClassName()+languageConfig.getClassFileExtension());
+ template.setAttribute("modelPackageName", config.getModelPackageName());
+ template.setAttribute("apiPackageName", config.getApiPackageName());
+ File aFile = new File(languageConfig.getLibraryHome() + "/src/main/as3/com/wordnik/swagger/common/" +
+ referencesModel.getGenratedClassName() + languageConfig.getClassFileExtension());
writeFile(aFile, template.toString(), "Model class");
}
}

0 comments on commit 0dda2fd

Please sign in to comment.