Package org.fusesource.hawtjni.runtime

Examples of org.fusesource.hawtjni.runtime.Library


    private void vsBasedBuild(File buildDir) throws CommandLineException, MojoExecutionException, IOException {
     
        FileUtils.copyDirectoryStructureIfModified(packageDirectory, buildDir);

        Library library = new Library(name);
        String platform;
        String configuration="release";
        if( "windows32".equals(library.getPlatform()) ) {
          platform = "Win32";
        } else if( "windows64".equals(library.getPlatform()) ) {
          platform = "x64";
        } else {
          throw new MojoExecutionException("Usupported platform: "+library.getPlatform());
        }

        boolean useMSBuild = false;
        String tool = windowsBuildTool.toLowerCase().trim();
        if( "detect".equals(tool) ) {
            String toolset = System.getenv("PlatformToolset");
            if( "Windows7.1SDK".equals(toolset) ) {
                useMSBuild = true;
            } else {
                String vcinstalldir = System.getenv("VCINSTALLDIR");
                if( vcinstalldir!=null ) {
                    if( vcinstalldir.contains("Microsoft Visual Studio 10") ||
                        vcinstalldir.contains("Microsoft Visual Studio 11") ||
                        vcinstalldir.contains("Microsoft Visual Studio 12")
                      ) {
                        useMSBuild = true;
                    }
                }
            }
        } else if( "msbuild".equals(tool) ) {
            useMSBuild = true;
        } else if( "vcbuild".equals(tool) ) {
            useMSBuild = false;
        } else {
            throw new MojoExecutionException("Invalid setting for windowsBuildTool: "+windowsBuildTool);
        }

        if( useMSBuild ) {
            // vcbuild was removed.. use the msbuild tool instead.
            int rc = cli.system(buildDir, new String[]{"msbuild", "vs2010.vcxproj", "/property:Platform="+platform, "/property:Configuration="+configuration});
            if( rc != 0 ) {
                throw new MojoExecutionException("vcbuild failed with exit code: "+rc);
            }
        } else {
            // try to use a vcbuild..
            int rc = cli.system(buildDir, new String[]{"vcbuild", "/platform:"+platform, "vs2008.vcproj", configuration});
            if( rc != 0 ) {
                throw new MojoExecutionException("vcbuild failed with exit code: "+rc);
            }
        }



        File libFile=FileUtils.resolveFile(buildDir, "target/"+platform+"-"+configuration+"/lib/"+library.getLibraryFileName());
        if( !libFile.exists() ) {
            throw new MojoExecutionException("vcbuild did not generate: "+libFile);
        }       

        File target=FileUtils.resolveFile(libDirectory, library.getPlatformSpecifcResourcePath());
        FileUtils.copyFile(libFile, target);

  }
View Full Code Here


        int rc = cli.system(buildDir, new String[]{"make", "install"});
        if( rc != 0 ) {
            throw new MojoExecutionException("make based build failed with exit code: "+rc);
        }
       
        Library library = new Library(name);
       
        File libFile = new File(distLibDirectory, library.getLibraryFileName());
        if( !libFile.exists() ) {
            throw new MojoExecutionException("Make based build did not generate: "+libFile);
        }
       
        if( platform == null ) {
            platform = library.getPlatform();
        }
       
        File target=FileUtils.resolveFile(libDirectory, library.getPlatformSpecifcResourcePath(platform));
        FileUtils.copyFile(libFile, target);
    }
View Full Code Here

    private List<String> osgiPlatforms;

    public void execute() throws MojoExecutionException {
        try {

            Library library = new Library(name);
            if (platform == null || platform.trim().length()==0 ) {
                platform = library.getPlatform();
            }

            String classifier = null;
            if( classified ) {
                classifier = platform;
View Full Code Here

TOP

Related Classes of org.fusesource.hawtjni.runtime.Library

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.