Qt for Android下载Gradle的一些信息提示


  • 网站研运

    以前Qt 5.3还是5.4的时候Qt for Android引入了Gradle,当时就发现Gradle下载非常慢。就产生了一个问题:

    为什么Qt Creator下载Gradle很慢,而我们用浏览器下载Gradle很快?
    我们能不能手动下载Gradle,然后放在Qt Creator可以感知的位置,这样可以省下大量的时间。

    今天我们终于成功地构下载好了Gradle了,以下的输出可能会给我们一点儿启示。目前我们使用的是Qt Creator 4.0。

    19:53:32: 为项目QtDreamMotionEditor_28执行步骤 ...
    19:53:32: 配置没有改变, 跳过 qmake 步骤。
    19:53:32: 正在启动 "/usr/bin/make" 
    
    cd src/ && ( test -e Makefile || /home/jiangcaiyang/Develop/Qt5.6.0/5.6/android_armv7/bin/qmake /media/jiangcaiyang/我的软件盘/QtProject/QtDreamMotionEditor_28/src/src.pro -spec android-g++ -o Makefile ) && /usr/bin/make -f Makefile 
    make[1]: Entering directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src'
    cd engine/ && ( test -e Makefile || /home/jiangcaiyang/Develop/Qt5.6.0/5.6/android_armv7/bin/qmake /media/jiangcaiyang/我的软件盘/QtProject/QtDreamMotionEditor_28/src/engine/engine.pro -spec android-g++ -o Makefile ) && /usr/bin/make -f Makefile 
    make[2]: Entering directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src/engine'
    cd core/ && ( test -e Makefile || /home/jiangcaiyang/Develop/Qt5.6.0/5.6/android_armv7/bin/qmake /media/jiangcaiyang/我的软件盘/QtProject/QtDreamMotionEditor_28/src/engine/core/core.pro -spec android-g++ -o Makefile ) && /usr/bin/make -f Makefile 
    make[3]: Entering directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src/engine/core'
    make[3]: Nothing to be done for 'first'.
    make[3]: Leaving directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src/engine/core'
    cd io/ && ( test -e Makefile || /home/jiangcaiyang/Develop/Qt5.6.0/5.6/android_armv7/bin/qmake /media/jiangcaiyang/我的软件盘/QtProject/QtDreamMotionEditor_28/src/engine/io/io.pro -spec android-g++ -o Makefile ) && /usr/bin/make -f Makefile 
    make[3]: Entering directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src/engine/io'
    make[3]: Nothing to be done for 'first'.
    make[3]: Leaving directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src/engine/io'
    cd system/ && ( test -e Makefile || /home/jiangcaiyang/Develop/Qt5.6.0/5.6/android_armv7/bin/qmake /media/jiangcaiyang/我的软件盘/QtProject/QtDreamMotionEditor_28/src/engine/system/system.pro -spec android-g++ -o Makefile ) && /usr/bin/make -f Makefile 
    make[3]: Entering directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src/engine/system'
    make[3]: Nothing to be done for 'first'.
    make[3]: Leaving directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src/engine/system'
    cd render/ && ( test -e Makefile || /home/jiangcaiyang/Develop/Qt5.6.0/5.6/android_armv7/bin/qmake /media/jiangcaiyang/我的软件盘/QtProject/QtDreamMotionEditor_28/src/engine/render/render.pro -spec android-g++ -o Makefile ) && /usr/bin/make -f Makefile 
    make[3]: Entering directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src/engine/render'
    make[3]: Nothing to be done for 'first'.
    make[3]: Leaving directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src/engine/render'
    make[2]: Leaving directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src/engine'
    cd plugins/ && ( test -e Makefile || /home/jiangcaiyang/Develop/Qt5.6.0/5.6/android_armv7/bin/qmake /media/jiangcaiyang/我的软件盘/QtProject/QtDreamMotionEditor_28/src/plugins/plugins.pro -spec android-g++ -o Makefile ) && /usr/bin/make -f Makefile 
    make[2]: Entering directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src/plugins'
    cd motioneditor/ && ( test -e Makefile || /home/jiangcaiyang/Develop/Qt5.6.0/5.6/android_armv7/bin/qmake /media/jiangcaiyang/我的软件盘/QtProject/QtDreamMotionEditor_28/src/plugins/motioneditor/motioneditor.pro -spec android-g++ -o Makefile ) && /usr/bin/make -f Makefile 
    make[3]: Entering directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src/plugins/motioneditor'
    make[3]: Nothing to be done for 'first'.
    make[3]: Leaving directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src/plugins/motioneditor'
    make[2]: Leaving directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src/plugins'
    cd app/ && ( test -e Makefile || /home/jiangcaiyang/Develop/Qt5.6.0/5.6/android_armv7/bin/qmake /media/jiangcaiyang/我的软件盘/QtProject/QtDreamMotionEditor_28/src/app/app.pro -spec android-g++ -o Makefile ) && /usr/bin/make -f Makefile 
    make[2]: Entering directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src/app'
    /home/jiangcaiyang/Develop/AndroidNDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ --sysroot=/home/jiangcaiyang/Develop/AndroidNDK/platforms/android-9/arch-arm/ -Wl,-soname,libQtDreamMotionEditor.so -Wl,-rpath=/home/jiangcaiyang/Develop/Qt5.6.0/5.6/android_armv7/lib -Wl,--no-undefined -Wl,-z,noexecstack -shared -o ../../../QtDreamMotionEditor_28/android-gxx-static/bin/libQtDreamMotionEditor.so main.o System.o qrc_Accessory.o qrc_QML.o moc_System.o   -L/home/jiangcaiyang/Develop/AndroidNDK/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a -L/home/jiangcaiyang/Develop/AndroidNDK/platforms/android-9/arch-arm//usr/lib -L/media/jiangcaiyang/我的软件盘/QtProject/QtDreamMotionEditor_28/android-gxx-static/lib -L/media/jiangcaiyang/我的软件盘/QtProject/QtDreamMotionEditor_28/android-gxx-static/bin -lMotionEditorPlugin -lRenderPlugin -lIOPlugin -lSystemPlugin -lCorePlugin -L/home/jiangcaiyang/Develop/Qt5.6.0/5.6/android_armv7/lib -lQt5Quick -lQt5Widgets -lQt5Gui -lQt5Qml -lQt5Network -lQt5AndroidExtras -lQt5Core -lGLESv2 -lgnustl_shared -llog -lz -lm -ldl -lc -lgcc
    make[2]: Leaving directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src/app'
    make[1]: Leaving directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src'
    19:53:33: 进程"/usr/bin/make"正常退出。
    19:53:33: 正在启动 "/usr/bin/make" INSTALL_ROOT=/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/android-build install
    
    cd src/ && ( test -e Makefile || /home/jiangcaiyang/Develop/Qt5.6.0/5.6/android_armv7/bin/qmake /media/jiangcaiyang/我的软件盘/QtProject/QtDreamMotionEditor_28/src/src.pro -spec android-g++ -o Makefile ) && /usr/bin/make -f Makefile install
    make[1]: Entering directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src'
    cd engine/ && ( test -e Makefile || /home/jiangcaiyang/Develop/Qt5.6.0/5.6/android_armv7/bin/qmake /media/jiangcaiyang/我的软件盘/QtProject/QtDreamMotionEditor_28/src/engine/engine.pro -spec android-g++ -o Makefile ) && /usr/bin/make -f Makefile install
    make[2]: Entering directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src/engine'
    cd core/ && ( test -e Makefile || /home/jiangcaiyang/Develop/Qt5.6.0/5.6/android_armv7/bin/qmake /media/jiangcaiyang/我的软件盘/QtProject/QtDreamMotionEditor_28/src/engine/core/core.pro -spec android-g++ -o Makefile ) && /usr/bin/make -f Makefile install
    make[3]: Entering directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src/engine/core'
    install -m 644 -p ../../../../QtDreamMotionEditor_28/android-gxx-static/lib/libCorePlugin.a /media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/android-build/libs/armeabi-v7a/libCorePlugin.a
    /home/jiangcaiyang/Develop/AndroidNDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ranlib /media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/android-build/libs/armeabi-v7a/libCorePlugin.a
    make[3]: Leaving directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src/engine/core'
    cd io/ && ( test -e Makefile || /home/jiangcaiyang/Develop/Qt5.6.0/5.6/android_armv7/bin/qmake /media/jiangcaiyang/我的软件盘/QtProject/QtDreamMotionEditor_28/src/engine/io/io.pro -spec android-g++ -o Makefile ) && /usr/bin/make -f Makefile install
    make[3]: Entering directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src/engine/io'
    install -m 644 -p ../../../../QtDreamMotionEditor_28/android-gxx-static/lib/libIOPlugin.a /media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/android-build/libs/armeabi-v7a/libIOPlugin.a
    /home/jiangcaiyang/Develop/AndroidNDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ranlib /media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/android-build/libs/armeabi-v7a/libIOPlugin.a
    make[3]: Leaving directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src/engine/io'
    cd system/ && ( test -e Makefile || /home/jiangcaiyang/Develop/Qt5.6.0/5.6/android_armv7/bin/qmake /media/jiangcaiyang/我的软件盘/QtProject/QtDreamMotionEditor_28/src/engine/system/system.pro -spec android-g++ -o Makefile ) && /usr/bin/make -f Makefile install
    make[3]: Entering directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src/engine/system'
    install -m 644 -p ../../../../QtDreamMotionEditor_28/android-gxx-static/lib/libSystemPlugin.a /media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/android-build/libs/armeabi-v7a/libSystemPlugin.a
    /home/jiangcaiyang/Develop/AndroidNDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ranlib /media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/android-build/libs/armeabi-v7a/libSystemPlugin.a
    make[3]: Leaving directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src/engine/system'
    cd render/ && ( test -e Makefile || /home/jiangcaiyang/Develop/Qt5.6.0/5.6/android_armv7/bin/qmake /media/jiangcaiyang/我的软件盘/QtProject/QtDreamMotionEditor_28/src/engine/render/render.pro -spec android-g++ -o Makefile ) && /usr/bin/make -f Makefile install
    make[3]: Entering directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src/engine/render'
    install -m 644 -p ../../../../QtDreamMotionEditor_28/android-gxx-static/lib/libRenderPlugin.a /media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/android-build/libs/armeabi-v7a/libRenderPlugin.a
    /home/jiangcaiyang/Develop/AndroidNDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ranlib /media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/android-build/libs/armeabi-v7a/libRenderPlugin.a
    make[3]: Leaving directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src/engine/render'
    make[2]: Leaving directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src/engine'
    cd plugins/ && ( test -e Makefile || /home/jiangcaiyang/Develop/Qt5.6.0/5.6/android_armv7/bin/qmake /media/jiangcaiyang/我的软件盘/QtProject/QtDreamMotionEditor_28/src/plugins/plugins.pro -spec android-g++ -o Makefile ) && /usr/bin/make -f Makefile install
    make[2]: Entering directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src/plugins'
    cd motioneditor/ && ( test -e Makefile || /home/jiangcaiyang/Develop/Qt5.6.0/5.6/android_armv7/bin/qmake /media/jiangcaiyang/我的软件盘/QtProject/QtDreamMotionEditor_28/src/plugins/motioneditor/motioneditor.pro -spec android-g++ -o Makefile ) && /usr/bin/make -f Makefile install
    make[3]: Entering directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src/plugins/motioneditor'
    install -m 644 -p ../../../../QtDreamMotionEditor_28/android-gxx-static/lib/libMotionEditorPlugin.a /media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/android-build/libs/armeabi-v7a/libMotionEditorPlugin.a
    /home/jiangcaiyang/Develop/AndroidNDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ranlib /media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/android-build/libs/armeabi-v7a/libMotionEditorPlugin.a
    make[3]: Leaving directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src/plugins/motioneditor'
    make[2]: Leaving directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src/plugins'
    cd app/ && ( test -e Makefile || /home/jiangcaiyang/Develop/Qt5.6.0/5.6/android_armv7/bin/qmake /media/jiangcaiyang/我的软件盘/QtProject/QtDreamMotionEditor_28/src/app/app.pro -spec android-g++ -o Makefile ) && /usr/bin/make -f Makefile install
    make[2]: Entering directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src/app'
    install -m 755 -p ../../../QtDreamMotionEditor_28/android-gxx-static/bin/libQtDreamMotionEditor.so /media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/android-build/libs/armeabi-v7a/libQtDreamMotionEditor.so
    make[2]: Leaving directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src/app'
    make[1]: Leaving directory '/media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src'
    19:53:34: 进程"/usr/bin/make"正常退出。
    19:53:34: 正在启动 "/home/jiangcaiyang/Develop/Qt5.6.0/5.6/android_armv7/bin/androiddeployqt" --input /media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src/app/android-libQtDreamMotionEditor.so-deployment-settings.json --output /media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/android-build --deployment bundled --android-platform android-23 --jdk /usr/lib/jvm/java-8-openjdk-amd64 --gradle
    Generating Android Package
      Input file: /media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/src/app/android-libQtDreamMotionEditor.so-deployment-settings.json
      Output directory: /media/jiangcaiyang/我的软件盘/QtProject/build-QtDreamMotionEditor_28-Android_armeabi_v7a_GCC_4_9_Qt_5_6_0-Release/android-build/
      Application binary: /media/jiangcaiyang/我的软件盘/QtProject/QtDreamMotionEditor_28/android-gxx-static/bin/libQtDreamMotionEditor.so
      Android build platform: android-23
      Install to device: No
    Warning: QML import could not be resolved in any of the import paths: QtQuick.Extras.Private
    Warning: QML import could not be resolved in any of the import paths: QtQuick.Extras.Private.CppUtils
    Warning: QML import could not be resolved in any of the import paths: QtQuick.Extras.Private.CppUtils
    Downloading https://services.gradle.org/distributions/gradle-2.2.1-all.zip
    ..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
    Unzipping /home/jiangcaiyang/.gradle/wrapper/dists/gradle-2.2.1-all/6dibv5rcnnqlfbq9klf8imrndn/gradle-2.2.1-all.zip to /home/jiangcaiyang/.gradle/wrapper/dists/gradle-2.2.1-all/6dibv5rcnnqlfbq9klf8imrndn
    Set executable permissions for: /home/jiangcaiyang/.gradle/wrapper/dists/gradle-2.2.1-all/6dibv5rcnnqlfbq9klf8imrndn/gradle-2.2.1/bin/gradle
    Download https://jcenter.bintray.com/com/android/tools/build/gradle/1.1.0/gradle-1.1.0.pom
    Download https://jcenter.bintray.com/com/android/tools/build/gradle-core/1.1.0/gradle-core-1.1.0.pom
    Download https://jcenter.bintray.com/com/android/tools/build/builder/1.1.0/builder-1.1.0.pom
    Download https://jcenter.bintray.com/com/android/tools/lint/lint/24.1.0/lint-24.1.0.pom
    Download https://jcenter.bintray.com/net/sf/proguard/proguard-gradle/5.1/proguard-gradle-5.1.pom
    Download https://jcenter.bintray.com/net/sf/proguard/proguard-parent/5.1/proguard-parent-5.1.pom
    Download https://jcenter.bintray.com/com/android/tools/build/builder-model/1.1.0/builder-model-1.1.0.pom
    Download https://jcenter.bintray.com/com/android/tools/build/builder-test-api/1.1.0/builder-test-api-1.1.0.pom
    Download https://jcenter.bintray.com/com/android/tools/sdklib/24.1.0/sdklib-24.1.0.pom
    Download https://jcenter.bintray.com/com/android/tools/sdk-common/24.1.0/sdk-common-24.1.0.pom
    Download https://jcenter.bintray.com/com/android/tools/common/24.1.0/common-24.1.0.pom
    Download https://jcenter.bintray.com/com/android/tools/build/manifest-merger/24.1.0/manifest-merger-24.1.0.pom
    Download https://jcenter.bintray.com/com/android/tools/ddms/ddmlib/24.1.0/ddmlib-24.1.0.pom
    Download https://jcenter.bintray.com/com/squareup/javawriter/2.5.0/javawriter-2.5.0.pom
    Download https://jcenter.bintray.com/org/sonatype/oss/oss-parent/7/oss-parent-7.pom
    Download https://jcenter.bintray.com/org/bouncycastle/bcpkix-jdk15on/1.48/bcpkix-jdk15on-1.48.pom
    Download https://jcenter.bintray.com/org/bouncycastle/bcprov-jdk15on/1.48/bcprov-jdk15on-1.48.pom
    Download https://jcenter.bintray.com/org/ow2/asm/asm/5.0.3/asm-5.0.3.pom
    Download https://jcenter.bintray.com/org/ow2/asm/asm-parent/5.0.3/asm-parent-5.0.3.pom
    Download https://jcenter.bintray.com/org/ow2/ow2/1.3/ow2-1.3.pom
    Download https://jcenter.bintray.com/org/ow2/asm/asm-tree/5.0.3/asm-tree-5.0.3.pom
    Download https://jcenter.bintray.com/com/android/tools/lint/lint-checks/24.1.0/lint-checks-24.1.0.pom
    Download https://jcenter.bintray.com/org/eclipse/jdt/core/compiler/ecj/4.4/ecj-4.4.pom
    Download https://jcenter.bintray.com/net/sf/proguard/proguard-base/5.1/proguard-base-5.1.pom
    Download https://jcenter.bintray.com/com/android/tools/annotations/24.1.0/annotations-24.1.0.pom
    Download https://jcenter.bintray.com/com/android/tools/layoutlib/layoutlib-api/24.1.0/layoutlib-api-24.1.0.pom
    Download https://jcenter.bintray.com/com/android/tools/dvlib/24.1.0/dvlib-24.1.0.pom
    Download https://jcenter.bintray.com/org/apache/commons/commons-compress/1.8.1/commons-compress-1.8.1.pom
    Download https://jcenter.bintray.com/org/apache/commons/commons-parent/33/commons-parent-33.pom
    Download https://jcenter.bintray.com/org/apache/apache/13/apache-13.pom
    Download https://jcenter.bintray.com/org/apache/httpcomponents/httpclient/4.1.1/httpclient-4.1.1.pom
    Download https://jcenter.bintray.com/org/apache/httpcomponents/httpcomponents-client/4.1.1/httpcomponents-client-4.1.1.pom
    Download https://jcenter.bintray.com/org/apache/httpcomponents/project/4.1.1/project-4.1.1.pom
    Download https://jcenter.bintray.com/org/apache/httpcomponents/httpmime/4.1/httpmime-4.1.pom
    Download https://jcenter.bintray.com/org/apache/httpcomponents/httpcomponents-client/4.1/httpcomponents-client-4.1.pom
    Download https://jcenter.bintray.com/com/google/code/gson/gson/2.2.4/gson-2.2.4.pom
    Download https://jcenter.bintray.com/com/google/guava/guava/17.0/guava-17.0.pom
    Download https://jcenter.bintray.com/com/google/guava/guava-parent/17.0/guava-parent-17.0.pom
    Download https://jcenter.bintray.com/net/sf/kxml/kxml2/2.3.0/kxml2-2.3.0.pom
    Download https://jcenter.bintray.com/com/android/tools/lint/lint-api/24.1.0/lint-api-24.1.0.pom
    Download https://jcenter.bintray.com/org/ow2/asm/asm-analysis/5.0.3/asm-analysis-5.0.3.pom
    Download https://jcenter.bintray.com/org/apache/httpcomponents/httpcore/4.1/httpcore-4.1.pom
    Download https://jcenter.bintray.com/org/apache/httpcomponents/httpcomponents-core/4.1/httpcomponents-core-4.1.pom
    Download https://jcenter.bintray.com/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.pom
    Download https://jcenter.bintray.com/org/apache/commons/commons-parent/5/commons-parent-5.pom
    Download https://jcenter.bintray.com/org/apache/apache/4/apache-4.pom
    Download https://jcenter.bintray.com/commons-codec/commons-codec/1.4/commons-codec-1.4.pom
    Download https://jcenter.bintray.com/org/apache/commons/commons-parent/11/commons-parent-11.pom
    Download https://jcenter.bintray.com/com/android/tools/external/lombok/lombok-ast/0.2.3/lombok-ast-0.2.3.pom
    Download https://jcenter.bintray.com/com/android/tools/build/gradle/1.1.0/gradle-1.1.0.jar
    

    以后或许我们可以利用这些提示来解决一些问题呢。


Log in to reply
 

走马观花

最近的回复

  • F

    @jiangcaiyang 大佬,《Memory Model》这本书能不能发我邮箱,百度搜了没找到,我邮箱1056406457@qq.com

    read more
  • boost.asio是一个很棒的网络库,这回儿我也开始系统地学习起来了。想想当年接触boost,也有八年多了。这次开始接触boost,觉得既熟悉又陌生。熟悉的是小写字母+下划线的命名方式、晦涩的模板、很慢的编译速度以及较大的程序体积,陌生的是asio的各种概念:io服务、接收器、套接字等等:我之前对网络编程不是非常了解。

    于是根据我的理解,参考《Boost.Asio C++网络编程》实现了这样一个简单的客户端和服务端通信的例子,例子非常简单,还不完善,但是幸运的是,可以在本机上互通了。
    下面是客户端的代码:

    #include <iostream> #include <boost/asio.hpp> #include <boost/proto/detail/ignore_unused.hpp> using namespace std; using namespace boost::asio; using namespace boost::system; using namespace boost::proto::detail;// 提供ignore_unused方法 void writeHandler( const boost::system::error_code& ec, size_t bytesTransferred ) { if ( ec ) { cout << "Write data error, code: " << ec.value( ) << "transferred: " << bytesTransferred << endl; } else { cout << "OK! " << bytesTransferred << "bytes written. " << endl; } } int main(int argc, char *argv[]) { ignore_unused( argc ); ignore_unused( argv ); io_service service; ip::tcp::socket sock( service ); ip::tcp::endpoint ep( ip::address::from_string( "127.0.0.1" ), 6545 ); boost::system::error_code ec; sock.connect( ep, ec ); if ( ec ) { cout << "Connect error, code: " << ec.value( ) << ", We will exit." << endl; return ec.value( ); } else { char buf[1024] = "Hello world!"; sock.async_write_some( buffer( buf ), writeHandler ); sock.close( ); } return service.run( ); }

    下面是服务端的代码:

    #include <iostream> #include <boost/asio.hpp> #include <boost/proto/detail/ignore_unused.hpp> using namespace std; using namespace boost::asio; using namespace boost::system; using namespace boost::proto::detail;// 提供ignore_unused方法 void acceptHandle( const boost::system::error_code& code ) { cout << "Accepted." << endl; } int main(int argc, char *argv[]) { ignore_unused( argc ); ignore_unused( argv ); io_service service; ip::tcp::endpoint ep( ip::address::from_string( "127.0.0.1" ), 6545 ); boost::system::error_code ec; ip::tcp::socket sock( service ); ip::tcp::acceptor acceptor( service, ep ); acceptor.async_accept( sock, acceptHandle ); if ( ec ) { cout << "There is an error in server. code: " << ec.value( ) << endl; } return service.run( );// 阻塞运行 }

    运行结果是这样的:
    78448d7b-b3ae-42fc-9e2e-4dd2fbdac2c2-image.png

    我对boost.asio中几个概念的理解:

    io_service,这就是一个类似事件循环的东西,它为io设备提供服务,故名。不管是套接字、文件还是串口设备,都要使用它的服务。它的run()函数相当于启动了一个事件循环。一旦有消息了,即进行响应。这也是实现异步编程的重要基础。 socket,这个类则是套接字,可以处理TCP或者是UDP请求。有同步以及异步的处理方式,也有带异常以及不带异常的处理方式。 acceptor,接收器,仅仅是服务端使用。相当于其余框架中的listener,作接收用的。

    比较浅显,如果有不当之处,敬请指正。

    read more
  • 843143141.jpg
    闲下来了,我又开始大规模地学习了。
    最近开始学习内存模型和无锁结构。因为这个是和操作系统密切相关的,懂得这些对于编写C++服务端应用程序
    有着非常好的帮助。之前我对内存模型以及无锁结构几乎没有什么了解,我就询问群里的大佬看看有没有可以参考的资料。
    大佬很高兴,并且推荐了我一本名为《Memory Model》的电子书。这本电子书虽然页数不多,但是从起源到发展,
    从源码到汇编,都给我们详细地介绍了。看了一遍,不是非常理解,但是依然尝试将自己的理解写下来,以便日后翻阅。
    首先因为多核处理器成为主流,多线程的程序已经非常常见,因此我们不可避免地要处理多线程程序的同步问题。
    然后,因为编译器默认都对源码进行了优化,在单核处理器中这通常不是什么问题,但是在多核处理器中,就会因为编译器
    对其进行了乱序处理而导致程序出现问题。由此深入地探讨内存模型。
    内存模型主要分为:
    载-载 顺序(load-load order)
    载-存 顺序(load-store order)
    存-载 顺序(store-load order)
    存-存 顺序(store-store order)
    依赖载入顺序(dependent loads order)

    通过内存栅栏(memory barrier)能够避免编译器对指令的乱序。Linux中有

    READ_ONCE( x, value ) WRITE_ONCE( x )

    避免这些读写被编译器乱序或者是优化掉。

    这里谈到volatile关键字。在另外一篇博客上说,volatile具有“易变性、不可优化性、顺序性”。简单说,由于
    被volatile声明的变量,指令须从内存读取,并且不能被编译器乱序以及优化。在Java(语言扩展)和MSVC(系统兼容)上,
    还附带了Accquire()和Release()语义,因此可部分用于多线程环境。但多数情况下,还是慎用volatile,
    因为不同架构的处理器,它的内存模型是千变万化的,不能一而概之。

    至于C++11,它提供了std::atomic<T>这个模板类,相当于提供了很多方式来实现不同内存模型的原子操作。
    它的load()和store()方法,第二个参数有以下几个选项:

    std::memory_order_relaxed std::memory_order_seq_cst std::memory_order_acq_rel std::memory_order_acquire std::memory_order_release std::memory_order_consume

    我们最常用来实现RCpc(Release Consistency、Processor Consistency)是使用

    std::memory_order_acquire std::memory_order_release

    这两对。

    作为例子,在实现自旋锁时使用std::atomic<T>是这样的:

    struct SpinLock2 { void lock( ) { for ( ; ; ) { while ( lock_.load( std::memory_order_relaxed ) ); if ( !lock_.exchange( true, std::memory_order_acquire ) ) break; } } void unlock( ) { lock_.store( false, std::memory_order_release ); } std::atomic<bool> lock_ = { false }; };

    read more
  • 113.jpg
    1、什么是lambda表达式,什么是闭包?
    lambda表达式即lambda函数,也就是匿名函数。

    lambda表达式在C++中包含了
    []表示捕获
    ()是函数的参数,需要指定类型
    ->type是返回的类型,可以省略,如果编译器无法推出类型的话可以强制编写
    {}是函数体。

    lambda可以被声明为mutable的,作用是将捕获的内容进行改变。
    闭包是函数的定义以及定义函数时提供的环境,总称为闭包。lambda函数也是一种闭包。
    lambda本身是匿名函数,而捕获语句则是提供了定义函数时提供的环境。

    2、什么是右值引用?
    右值引用相对与左值引用而言的。左值即=运算符左边的变量,右值是=运算符右边的常量或变量。由此可以看出,
    右值引用指的是对常量或变量的引用。它的用途包含了移动语义和完美转发。
    移动语义就是弥补了C++历史在处理变量传递时丢失的一种语义。它和值传递、引用传递一样,是变量传递的方式之一。
    如果没有移动语义,为了将一个类的实例传递给另外一个实例,就需要额外地进行构造、赋值、销毁的操作。
    对于一些比较复杂的变量,的确是非常耗时并且消耗大的操作。(浪费指令时间、浪费内存)

    对于这样的函数返回:
    vector<string> str_split(const string& s) {
    vector<string> v;
    // ...
    return v; // v是左值,但优先移动,不支持移动时仍可复制。
    }

    标准要求先调用移动构造函数,如果不符合那么再调用拷贝构造函数。所以可以轻松地写出这种写法而不必担心效率问题。
    同时,现代编译器都会对返回值进行优化,成为RVO以及NRVO。所以不用太担心会多调用构造析构函数。

    对于完美转发,C++对于引用的转发有规则。传统的C++是无法对引用进行再引用的。但是现代的C++放宽了它的使用范围。
    只有右引用右值的时候,才会产生右引用。这也称为引用折叠。

    3、auto关键字的作用是什么?
    auto关键字为的是能够让编译器自动推导类型。自C++98之后,编译器对类型的推导变得越来越智能了。
    而我们在编写复杂代码的时候,冗长的类型不仅容易出错,有时也不容易人工推导出类型。
    因此auto可以简化我们的任务量,让类型的推导交给编译器完成。
    除了auto外,我们还可以使用decltype()来让编译器推导类型。

    read more

关注我们

微博
QQ群