2013-08-29 3 views
0

phonegap/cordova 용 플러그인을 개발하고 싶습니다. 나는cordova 빌드 작업 사용자 정의

것은 내가 명령 줄에서 실행할// 플러그인에 폴더를 생성합니다 :

phonegap build android 또는 phonegap run android

나는 내 플러그인 폴더에서 복사 된 .java 파일을 가지고 싶습니다/platform/android/src

설치시 대부분의 플러그인이 복사되지만 빌드, 실행 작업에는 복사되지 않습니다.

편집 할 XML 파일을 어디에 두어야할까요?

편집 : Here에서

내가 before_build 파일/작업/어딘가에 만들어 선언해야 할 것 같다, 어디? 는 - 그리고 after_plugin_add

답변

0

HereHere 설치 스크립트의 소스되게 무엇을 할 필요가있다.

실행/빌드에서 실행해야 할 코드 부분은 다음과 같습니다

// queue up native stuff 
     sourceFiles && sourceFiles.forEach(function(source) { 
      actions.push(actions.createAction(handler["source-file"].install, [source, plugin_dir, project_dir, plugin_id], handler["source-file"].uninstall, [source, project_dir, plugin_id])); 
     }); 

     headerFiles && headerFiles.forEach(function(header) { 
      actions.push(actions.createAction(handler["header-file"].install, [header, plugin_dir, project_dir, plugin_id], handler["header-file"].uninstall, [header, project_dir, plugin_id])); 
     }); 

     resourceFiles && resourceFiles.forEach(function(resource) { 
      actions.push(actions.createAction(handler["resource-file"].install, [resource, plugin_dir, project_dir], handler["resource-file"].uninstall, [resource, project_dir])); 
     }); 

     libFiles && libFiles.forEach(function(lib) { 
      actions.push(actions.createAction(handler["lib-file"].install, [lib, plugin_dir, project_dir], handler["lib-file"].uninstall, [lib, project_dir])); 
     }); 




// run through the action stack 
actions.process(platform, project_dir, function(err) { 
    if (err) { 
     if (callback) callback(err); 
     else throw err; 
    } else { 

     // queue up the plugin so prepare knows what to do. 
     config_changes.add_installed_plugin_to_prepare_queue(plugins_dir, plugin_basename, platform, filtered_variables, is_top_level); 
     // call prepare after a successful install 
     require('./../plugman').prepare(project_dir, platform, plugins_dir); 

     require('../plugman').emit('results', plugin_id + ' installed.'); 

Here는 그 이름과 폴더 구조를 설명 응답입니다.