国产片侵犯亲女视频播放_亚洲精品二区_在线免费国产视频_欧美精品一区二区三区在线_少妇久久久_在线观看av不卡

服務器之家:專注于服務器技術及軟件下載分享
分類導航

PHP教程|ASP.NET教程|Java教程|ASP教程|編程技術|正則表達式|C/C++|IOS|C#|Swift|Android|VB|R語言|JavaScript|易語言|vb.net|

服務器之家 - 編程語言 - Android - 用于cocos2d-x引擎(ndk)中為android項目生成編譯文件列表

用于cocos2d-x引擎(ndk)中為android項目生成編譯文件列表

2021-03-02 15:16Android開發網 Android

在android的ndk項目中,添加很多源文件之后總要手動編寫makefile來添加所有的源文件, 很麻煩,所以寫了一個自動生成編譯源文件列表的小工具

復制代碼 代碼如下:


package com.leeass.generate;

 

import java.io.File;
import java.io.FileFilter;
import java.io.FileNotFoundException;

/**
 * 用于cocos2d-x引擎中android項目編譯文件列表生成
 * @author leeassamite
 *
 */
public class GenerateAndroidMakefile {
 /** 分隔符 */
 private static final String LINE_BREAK = System.getProperty("line.separator", "/n");
 /** classes文件夾 */
 private File classesDir = null;
 /** classes文件夾路徑 */
 private String classesPath = "";
 /** classes文件夾相對路徑 */
 private String classesRelativePath = "";
 /** 編譯文件過濾器 */
 private BuildFileFilter buildFileFilter = null;

 /**
  * 創建GenerateAndroidMakefile
  * @param classesAbsolutePath classes文件夾絕對路徑
  * @param classesRelativePath classes文件夾在編譯文件中的相對路徑
  * @throws Exception
  */
 public GenerateAndroidMakefile(String classesAbsolutePath,String classesRelativePath) throws Exception{
  if(classesRelativePath == null){
   throw new Exception("classes文件夾相對路徑錯誤,不能為NULL!");
  }
  if(classesAbsolutePath == null || "".equals(classesAbsolutePath)){
   throw new Exception("classes文件夾路徑輸入錯誤,不能為空!");
  }
  classesDir = new File(classesAbsolutePath);
  if((!classesDir.exists()) || (!classesDir.canRead()) || (!classesDir.isDirectory())){
   throw new FileNotFoundException("classes文件夾不可讀:"+classesDir.getAbsolutePath());
  }
  this.classesPath = classesAbsolutePath;
  this.classesPath = classesAbsolutePath.replaceAll("\\\\", "/");
  this.classesRelativePath = classesRelativePath;
  buildFileFilter = new BuildFileFilter();
 }

 /**
  * 輸出編譯文件列表
  */
 public void outputBuildFilesList(){
  StringBuilder buildFilesSb = new StringBuilder();
  outputBuildFileList(classesDir,buildFilesSb);
  System.out.println(buildFilesSb.toString());
 }
 private void outputBuildFileList(File buildfile,StringBuilder buildFilesSb){
  if(buildfile.isDirectory()){
   File[] files =buildfile.listFiles(buildFileFilter);
   for (File file : files) {
    outputBuildFileList(file,buildFilesSb);
   }
  }else{
   String buildfileStr = translateBuildFilePath(buildfile.getAbsolutePath()) + " \\";
   buildFilesSb.append(buildfileStr).append(LINE_BREAK);
  }
 }
 /**
  * 轉換編譯文件路徑
  * @param filepath
  * @return
  */
 private String translateBuildFilePath(String filepath){
  return filepath.replaceAll("\\\\", "/").replace(classesPath, classesRelativePath);
 }

 /**
  * @param args
  * @throws FileNotFoundException
  */
 public static void main(String[] args) throws Exception {
  String classesPath = "D:\\developer\\cocos2d-x-2.1.4\\projects\\hszg_ol\\Classes";
  String relativePath = "                   ../../Classes";
  GenerateAndroidMakefile gam = new GenerateAndroidMakefile(classesPath,relativePath);
  gam.outputBuildFilesList();
 }

 
 /**
  * 編譯文件過濾器
  * @author leeass
  *
  */
 class BuildFileFilter implements FileFilter{
  @Override
  public boolean accept(File pathname) {
   String name = pathname.getName().toLowerCase();
   return (!pathname.isHidden()) && (pathname.isDirectory() || name.endsWith(".c") || name.endsWith(".cpp"));
  }
 }

}



用于cocos2d-x引擎(ndk)中為android項目生成編譯文件列表

延伸 · 閱讀

精彩推薦
主站蜘蛛池模板: 婷婷综合| 亚洲精品一区二区三区精华液 | 91精品综合久久久久久五月天 | 中文字幕国产 | 夜夜操av| 亚洲欧美自拍偷拍 | 国产成人精品免费视频大全最热 | 蜜臀久久99精品久久久无需会员 | 国产精品福利一区二区三区 | 99精品欧美一区二区蜜桃免费 | 免费黄色在线观看 | 中文字幕欧美在线 | 午夜影院在线 | 亚洲一区二区三区在线免费观看 | 午夜看片网站 | 午夜小电影 | 日本在线播放 | 亚洲精品第一 | 精品日韩| 寡妇激情毛片免费视频 | 免费的黄视频 | 午夜精品网站 | 久久久一 | 亚洲一区二区在线免费观看 | 青青久在线视频 | 91麻豆精品国产91久久久更新资源速度超快 | 黄色毛片在线观看 | 国产精品久久久久久久久晋中 | 精品欧美 | 亚洲在线一区二区 | av午夜电影| 91在线视频在线 | 久久xxx| 麻豆国产一区二区三区 | 亚洲一区二区三区精品动漫 | 久久久久一区二区三区 | 免费观看av电影 | 久久av网| 中文字幕2019 | 精品久久久久久久久久久 | 一级片网 |