Use CMake 3.18.6 instead of 3.20, which has a problem when integrating
with Gradle.
This commit is contained in:
Radames S. Cruz Moreno 2021-04-07 15:28:42 -07:00
Родитель 7a19d662db
Коммит 3316ffc61b
4 изменённых файлов: 38 добавлений и 16 удалений

Просмотреть файл

@ -45,7 +45,7 @@ android {
version "3.12.0+"
}
}
ndkVersion "21.0.6113669"
ndkVersion "22.1.7171670"
}
dependencies {

Просмотреть файл

@ -9,7 +9,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.2'
classpath 'com.android.tools.build:gradle:4.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files

Просмотреть файл

@ -6,4 +6,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip

Просмотреть файл

@ -1,4 +1,18 @@
steps:
- task: PowerShell@2
displayName: Install CMake 3.18.6
inputs:
targetType: 'inline'
script: |
# Download specific version of CMake
$ToolsDirectory = Join-Path -Path $Env:BUILD_SOURCESDIRECTORY -ChildPath tools
$CMakeZipFile = Join-Path $ToolsDirectory -ChildPath cmake.zip
Invoke-WebRequest -Uri "https://cmake.org/files/v3.18/cmake-3.18.6-win64-x64.zip" -OutFile $CMakeZipFile
New-Item -Path $ToolsDirectory -Name "cmake" -ItemType "directory"
Expand-Archive -Path $CMakeZipFile -DestinationPath $ToolsDirectory/cmake
Copy-Item -Path $ToolsDirectory/cmake/cmake-3.18.6-win64-x64/* -Destination "c:/Program Files/CMake" -Recurse -Force
- task: CMake@1
displayName: Verify CMake version
inputs:
@ -17,38 +31,46 @@ steps:
Invoke-WebRequest -Uri "https://github.com/ninja-build/ninja/releases/download/v1.10.0/ninja-win.zip" -OutFile $NinjaZipFile
Expand-Archive -Path $NinjaZipFile -DestinationPath $ToolsDirectory
Copy-Item -Path $NinjaExeFile -Destination "c:\Program Files\CMake\bin"
Copy-Item -Path $NinjaExeFile -Destination "c:/Program Files/CMake/bin"
- task: CmdLine@2
displayName: Update NDK
inputs:
script: |
echo Android home: %ANDROID_HOME%
"%ANDROID_HOME%/tools/bin/sdkmanager.bat" --install ndk;21.0.6113669
echo Android home: %ANDROID_SDK_ROOT%
"%ANDROID_SDK_ROOT%/tools/bin/sdkmanager" --install "ndk;22.1.7171670"
- task: Gradle@2
displayName: Compile Android Native Libraries
inputs:
workingDirectory: '$(Build.SourcesDirectory)\android'
gradleWrapperFile: '$(Build.SourcesDirectory)\android\gradlew'
workingDirectory: '$(Build.SourcesDirectory)/android'
gradleWrapperFile: '$(Build.SourcesDirectory)/android/gradlew'
gradleOptions: ''
options: '--stacktrace --no-parallel'
publishJUnitResults: false
testResultsFiles: '**/TEST-*.xml'
tasks: 'compileReleaseSources'
- task: CopyFiles@2
displayName: Copy files to staging directory
inputs:
SourceFolder: '$(Build.SourcesDirectory)\android\app\.cxx\cmake\release\arm64-v8a\lib\arm64-v8a'
Contents: 'libsealc.so'
TargetFolder: '$(Build.ArtifactStagingDirectory)\lib\arm64-v8a'
#- task: CmdLine@2
# displayName: Compile Android Native Libraries
# inputs:
# script: |
# gradlew.bat --stacktrace --no-parallel compileReleaseSources
# workingDirectory: $(Build.SourcesDirectory)/android
- task: CopyFiles@2
displayName: Copy files to staging directory
inputs:
SourceFolder: '$(Build.SourcesDirectory)\android\app\.cxx\cmake\release\x86_64\lib\x86_64'
SourceFolder: '$(Build.SourcesDirectory)/android/app/.cxx/cmake/release/arm64-v8a/lib/arm64-v8a'
Contents: 'libsealc.so'
TargetFolder: '$(Build.ArtifactStagingDirectory)\lib\x86_64'
TargetFolder: '$(Build.ArtifactStagingDirectory)/lib/arm64-v8a'
- task: CopyFiles@2
displayName: Copy files to staging directory
inputs:
SourceFolder: '$(Build.SourcesDirectory)/android/app/.cxx/cmake/release/x86_64/lib/x86_64'
Contents: 'libsealc.so'
TargetFolder: '$(Build.ArtifactStagingDirectory)/lib/x86_64'
- task: PublishBuildArtifacts@1
displayName: Publish build artifacts