简体   繁体   English

这是模块,子项目,图书馆项目还是其他?

[英]Is this a Module, Sub-Project, Library Project or something else?

I am trying to install Android-GPU-Image in my project. 我正在尝试在我的项目中安装Android-GPU-Image。 https://github.com/CyberAgent/android-gpuimage https://github.com/Cyber​​Agent/android-gpuimage

When I download the source, it's broken down as such: 当我下载源代码时,它被细分为:

在此处输入图片说明

The github project does not include install instructions (other than a dependency line that didn't work for me) so I am trying to figure out how to install a package like this. github项目不包括安装说明(除了对我不起作用的依赖项之外),因此我试图弄清楚如何安装这样的软件包。

My question is: What is the general name of this 'android-gpuimage' folder in the context of adding it to a project? 我的问题是: 将“ android-gpuimage”文件夹添加到项目的上下文中的通用名称什么? Is this a Module, Sub-Project, Library-Project or what? 这是模块,子项目,库项目还是什么?

Update 更新资料

Here is my gradle file 这是我的gradle文件

import java.util.regex.Pattern

apply plugin: 'android'

buildscript {
    repositories {
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:1.1.1'
    }
}

project.ext {
    multiarch = false
    compileSdkVersion = Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)
    minSdkVersion = Integer.parseInt(project.ANDROID_BUILD_MIN_SDK_VERSION)
    targetSdkVersion = Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION)
    buildToolsVersion = project.ANDROID_BUILD_TOOLS_VERSION
}

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    compile 'com.android.support:support-v4:22.0.0'
    compile 'com.android.support:appcompat-v7:22.0.0'
    compile 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.2.3'
    compile project(':CordovaLib')
    compile project(':app-FacebookLib')
    compile files('libs/universal-image-loader-1.9.3.jar')
    compile files('libs/twitter4j-core-4.0.3.jar')
    compile files('libs/twitter4j-core-4.0.4-SNAPSHOT.jar')
    compile files('libs/Filters.jar')
}

android {
    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }
    }

    defaultConfig {
        versionCode Integer.parseInt("" + getVersionCodeFromManifest() + "0")
    }

    compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)
    buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION

    if (multiarch || System.env.BUILD_MULTIPLE_APKS) {
        productFlavors {
            armv7 {
                versionCode defaultConfig.versionCode + 2
                ndk {
                    abiFilters "armeabi-v7a", ""
                }
            }
            x86 {
                versionCode defaultConfig.versionCode + 4
                ndk {
                    abiFilters "x86", ""
                }
            }
            all {
                ndk {
                    abiFilters "all", ""
                }
            }
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }

}

task wrapper(type: Wrapper) {
    gradleVersion = '1.12'
}

def getVersionCodeFromManifest() {
    def manifestFile = file(android.sourceSets.main.manifest.srcFile)
    def pattern = Pattern.compile("versionCode=\"(\\d+)\"")
    def matcher = pattern.matcher(manifestFile.getText())
    matcher.find()
    return Integer.parseInt(matcher.group(1))
}

Answer: 回答:

Needed to add 需要添加

repositories {
    mavenCentral()
}

To my gradle, the one I already had was in the build script, I needed it outside that scope too. 令我欣慰的是,我已经拥有的一个在构建脚本中,我也需要在该范围之外。

https://stackoverflow.com/a/16675271/3324388 https://stackoverflow.com/a/16675271/3324388

What you have checked out of github is the entire project , which containes the library project and a sample project showing how to use the library. 您从github中签出的内容是整个项目,其中包含库项目和显示如何使用库的示例项目。

To use the library , you would have to include the dependency in gradle as mentioned 要使用该库,您必须如上所述将依赖项包含在gradle中

 dependencies {
    compile 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.2.3'
}

The gradle file lets you know what kind of project it is for example ,a library project would have gradle文件可让您知道它是什么样的项目,例如,一个图书馆项目

apply plugin: 'com.android.library'

and the main application project would have 而主应用程序项目将具有

apply plugin: 'com.android.application'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM