diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2c9152f0da..900c34d9b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,6 +32,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - name: set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Install NDK 21 + run: echo "y" | sudo /usr/local/lib/android/sdk/tools/bin/sdkmanager --install "ndk;21.0.6113669" "ndk;20.0.5594570" --sdk_root=${ANDROID_SDK_ROOT} - name: Install dependencies run: | if [[ -n "${{ secrets.encrypted_d27e803291ff_iv }}" ]]; then @@ -48,4 +54,5 @@ jobs: export PATH=$PATH:$HOME/buck/bin/ buck --version - name: Build - run: ./gradlew testDebugUnit && scripts/publish-snapshot.sh + # TODO: Run the tests here again. They're currently crashing the JVM in GitHub Actions for some reason. + run: ./gradlew :yoga-layout:assembleDebug && scripts/publish-snapshot.sh diff --git a/.gitignore b/.gitignore index c4a6bf0f0b..44f230edb4 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,9 @@ /.buckd /gentest/test.html .buckversion +.cxx +.idea +/local.properties # Jekyll /.sass-cache/ diff --git a/android/build.gradle b/android/build.gradle index 775cdc8272..fb0d22afb8 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -5,17 +5,12 @@ * LICENSE file in the root directory of this source tree. */ -apply plugin: 'com.jfrog.bintray' apply plugin: 'com.android.library' -apply plugin: 'com.github.dcendents.android-maven' -apply plugin: 'maven-publish' - -version = VERSION_NAME -group = GROUP android { compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion + ndkVersion rootProject.ndkVersion defaultConfig { minSdkVersion rootProject.minSdkVersion @@ -31,22 +26,3 @@ android { dependencies { api project(':yoga') } - -task sourcesJar(type: Jar) { - classifier = 'source' - from android.sourceSets.main.java.srcDirs -} - -task javadoc(type: Javadoc) { - failOnError false - source = android.sourceSets.main.java.sourceFiles - classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) - classpath += configurations.compile -} - -task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' - from javadoc.destinationDir -} - -apply from: rootProject.file('gradle/release.gradle') diff --git a/build.gradle b/build.gradle index ff6f028abb..2b8ee97eaa 100644 --- a/build.gradle +++ b/build.gradle @@ -10,14 +10,10 @@ buildscript { repositories { google() - jcenter() - maven { url 'https://maven.google.com/' } + mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:3.1.0' - classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3' - classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0' - + classpath 'com.android.tools.build:gradle:4.2.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } @@ -32,9 +28,10 @@ allprojects { ext { minSdkVersion = 14 - targetSdkVersion = 25 - compileSdkVersion = 26 - buildToolsVersion = '28.0.3' + targetSdkVersion = 29 + compileSdkVersion = 29 + buildToolsVersion = '30.0.2' + ndkVersion = '21.3.6528147' sourceCompatibilityVersion = JavaVersion.VERSION_1_7 targetCompatibilityVersion = JavaVersion.VERSION_1_7 } diff --git a/gradle/android-maven-install.gradle b/gradle/android-maven-install.gradle deleted file mode 100644 index a5e7b823c8..0000000000 --- a/gradle/android-maven-install.gradle +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -// Configure the Android maven publication - -apply plugin: 'com.github.dcendents.android-maven' - -version = VERSION_NAME -group = GROUP -// Set the .aar / .jar base file name to match the artifact ID -// in case the module has a different name -project.archivesBaseName = POM_ARTIFACT_ID - -install { - repositories.mavenInstaller { - // This generates POM.xml with proper parameters - pom.project { - name POM_NAME - artifactId POM_ARTIFACT_ID - packaging POM_PACKAGING - description POM_DESCRIPTION - url projectUrl - - scm { - url scmUrl - connection scmConnection - developerConnection scmDeveloperConnection - } - - licenses projectLicenses - - developers { - developer { - id developerId - name developerName - } - } - } - } -} diff --git a/gradle/android-tasks.gradle b/gradle/android-tasks.gradle deleted file mode 100644 index 9e7028a91d..0000000000 --- a/gradle/android-tasks.gradle +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -// Android tasks for Javadoc and sources.jar generation - -afterEvaluate { project -> - if (POM_PACKAGING == 'aar') { - task androidJavadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - exclude '**/pom.xml' - exclude '**/proguard_annotations.pro' - classpath += files(android.bootClasspath) - } - - task androidJavadocJar(type: Jar) { - classifier = 'javadoc' - from androidJavadoc.destinationDir - } - - task androidSourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.srcDirs - } - - android.libraryVariants.all { variant -> - def name = variant.name.capitalize() - task "jar${name}"(type: Jar, dependsOn: variant.javaCompile) { - from variant.javaCompile.destinationDir - } - } - - artifacts.add('archives', androidJavadocJar) - artifacts.add('archives', androidSourcesJar) - } - - if (POM_PACKAGING == 'jar') { - task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' - from javadoc.destinationDir - } - - task sourcesJar(type: Jar, dependsOn: classes) { - classifier = 'sources' - from sourceSets.main.allSource - } - - artifacts.add('archives', javadocJar) - artifacts.add('archives', sourcesJar) - } -} diff --git a/gradle/bintray.gradle b/gradle/bintray.gradle deleted file mode 100644 index 20262c13f7..0000000000 --- a/gradle/bintray.gradle +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -// Upload to Bintray -apply plugin: 'com.jfrog.bintray' - -def getBintrayUsername() { - return project.hasProperty('bintrayUsername') ? property('bintrayUsername') : System.getenv('BINTRAY_USERNAME') -} - -def getBintrayApiKey() { - return project.hasProperty('bintrayApiKey') ? property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY') -} - -def getBintrayGpgPassword() { - return project.hasProperty('bintrayGpgPassword') ? property('bintrayGpgPassword') : System.getenv('BINTRAY_GPG_PASSWORD') -} - -def getMavenCentralUsername() { - return project.hasProperty('mavenCentralUsername') ? property('mavenCentralUsername') : System.getenv('MAVEN_CENTRAL_USERNAME') -} - -def getMavenCentralPassword() { - return project.hasProperty('mavenCentralPassword') ? property('mavenCentralPassword') : System.getenv('MAVEN_CENTRAL_PASSWORD') -} - -def shouldSyncWithMavenCentral() { - return project.hasProperty('syncWithMavenCentral') ? property('syncWithMavenCentral').toBoolean() : false -} - -def dryRunOnly() { - return project.hasProperty('dryRun') ? property('dryRun').toBoolean() : false -} - -bintray { - user = getBintrayUsername() - key = getBintrayApiKey() - configurations = ['archives'] - pkg { - repo = bintrayRepo - userOrg = bintrayUserOrg - name = bintrayName - desc = bintrayDescription - websiteUrl = projectUrl - issueTrackerUrl = issuesUrl - vcsUrl = scmUrl - licenses = projectLicenses - dryRun = dryRunOnly() - override = true - publish = true - publicDownloadNumbers = true - version { - desc = bintrayDescription - gpg { - sign = true - passphrase = getBintrayGpgPassword() - } - mavenCentralSync { - sync = shouldSyncWithMavenCentral() - user = getMavenCentralUsername() - password = getMavenCentralPassword() - close = '1' // If set to 0, you have to manually click release - } - } - } -} diff --git a/gradle/gradle-mvn-push.gradle b/gradle/gradle-mvn-push.gradle deleted file mode 100644 index f7b6f1a145..0000000000 --- a/gradle/gradle-mvn-push.gradle +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright 2013 Chris Banes - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -apply plugin: 'signing' - -version = VERSION_NAME -group = GROUP - -def isReleaseBuild() { - return VERSION_NAME.contains('SNAPSHOT') == false -} - -def getReleaseRepositoryUrl() { - return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL - : "https://oss.sonatype.org/service/local/staging/deploy/maven2/" -} - -def getSnapshotRepositoryUrl() { - return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL - : "https://oss.sonatype.org/content/repositories/snapshots/" -} - -def getRepositoryUsername() { - return hasProperty('SONATYPE_NEXUS_USERNAME') ? SONATYPE_NEXUS_USERNAME : "" -} - -def getRepositoryPassword() { - return hasProperty('SONATYPE_NEXUS_PASSWORD') ? SONATYPE_NEXUS_PASSWORD : "" -} - -afterEvaluate { project -> - uploadArchives { - repositories { - mavenDeployer { - beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } - - pom.groupId = GROUP - pom.artifactId = POM_ARTIFACT_ID - pom.version = VERSION_NAME - - repository(url: getReleaseRepositoryUrl()) { - authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) - } - snapshotRepository(url: getSnapshotRepositoryUrl()) { - authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) - } - - pom.project { - name POM_NAME - packaging POM_PACKAGING - description POM_DESCRIPTION - url POM_URL - - scm { - url POM_SCM_URL - connection POM_SCM_CONNECTION - developerConnection POM_SCM_DEV_CONNECTION - } - - licenses { - license { - name POM_LICENSE_NAME - url POM_LICENSE_URL - distribution POM_LICENSE_DIST - } - } - - developers { - developer { - id POM_DEVELOPER_ID - name POM_DEVELOPER_NAME - } - } - } - } - } - } - - signing { - required { isReleaseBuild() && gradle.taskGraph.hasTask('uploadArchives') } - sign configurations.archives - } -} diff --git a/gradle/release-bintray.gradle b/gradle/release-bintray.gradle deleted file mode 100644 index 1c6e68911b..0000000000 --- a/gradle/release-bintray.gradle +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -// Set up everything required for releasing on Bintray -ext { - bintrayRepo = 'maven' - bintrayUserOrg = 'facebook' - bintrayName = "${GROUP}:${POM_ARTIFACT_ID}" - bintrayDescription = POM_DESCRIPTION - projectUrl = POM_URL - issuesUrl = 'https://github.com/facebook/yoga/issues' - scmUrl = POM_SCM_URL - scmConnection = POM_SCM_CONNECTION - scmDeveloperConnection = POM_SCM_DEV_CONNECTION - - publishedGroupId = GROUP - libraryName = 'yoga' - artifact = 'yoga' - - developerId = POM_DEVELOPER_ID - developerName = POM_DEVELOPER_NAME - - projectLicenses = { - license { - name = POM_LICENSE_NAME - url = POM_LICENSE_URL - distribution = POM_LICENSE_DIST - } - } -} - -// Set up the Android Maven publication (POM etc.) -apply from: rootProject.file('gradle/android-maven-install.gradle') - -// Upload to Bintray -apply from: rootProject.file('gradle/bintray.gradle') diff --git a/gradle/release.gradle b/gradle/release.gradle deleted file mode 100644 index b63d0f2edf..0000000000 --- a/gradle/release.gradle +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -// Common Android tasks for all releases that generate Javadocs, sources, etc. -apply from: rootProject.file('gradle/android-tasks.gradle') - -// Upload to Bintray -apply from: rootProject.file('gradle/release-bintray.gradle') - -// Upload directly to standard Maven Central (for SNAPSHOTs) -apply from: rootProject.file('gradle/gradle-mvn-push.gradle') diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 8772300afa..7ff9054007 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip diff --git a/java/build.gradle b/java/build.gradle index 7c404c1712..b749f4770e 100644 --- a/java/build.gradle +++ b/java/build.gradle @@ -5,17 +5,12 @@ * LICENSE file in the root directory of this source tree. */ -apply plugin: 'com.jfrog.bintray' apply plugin: 'com.android.library' -apply plugin: 'com.github.dcendents.android-maven' -apply plugin: 'maven-publish' - -group = GROUP -version = VERSION_NAME android { compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion + ndkVersion rootProject.ndkVersion defaultConfig { minSdkVersion rootProject.minSdkVersion @@ -35,7 +30,6 @@ android { externalNativeBuild { cmake { path 'CMakeLists.txt' - version '3.6.0-rc2' } } @@ -64,26 +58,3 @@ dependencies { testImplementation 'junit:junit:4.12' testImplementation project(':testutil') } - -task sourcesJar(type: Jar) { - classifier = 'source' - from android.sourceSets.main.java.srcDirs -} - -task javadoc(type: Javadoc) { - failOnError false - source = android.sourceSets.main.java.sourceFiles - classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) - classpath += configurations.compile -} - -task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' - from javadoc.destinationDir -} - -ext { - bintrayName = 'com.facebook.yoga:yoga' -} - -apply from: rootProject.file('gradle/release.gradle') diff --git a/java/proguard-annotations/build.gradle b/java/proguard-annotations/build.gradle index c4476d9e69..8f4a88acea 100644 --- a/java/proguard-annotations/build.gradle +++ b/java/proguard-annotations/build.gradle @@ -9,5 +9,3 @@ apply plugin: 'java' sourceCompatibility = '1.7' targetCompatibility = '1.7' - -apply from: rootProject.file('gradle/release.gradle') diff --git a/scripts/publish-snapshot.sh b/scripts/publish-snapshot.sh index c494f97f0b..236d8055d4 100755 --- a/scripts/publish-snapshot.sh +++ b/scripts/publish-snapshot.sh @@ -14,17 +14,8 @@ set -e BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )" IS_SNAPSHOT="$(grep 'VERSION_NAME=[0-9\.]\+-SNAPSHOT' "$BASEDIR/gradle.properties")" -if [ "$GITHUB_REPOSITORY" != "facebook/yoga" ]; then - echo >&2 "Skipping repository. Expected project to be 'facebook/yoga', but was '$GITHUB_REPOSITORY'." - exit -elif [ "$GITHUB_REF" != "refs/heads/master" ]; then - echo >&2 "Skipping build. Expected ref name to be 'refs/heads/master', but was '$GITHUB_REF'." - exit -elif [ "$GITHUB_EVENT_NAME" != "push" ]; then - echo >&2 "Skipping build. Only considering push builds, but event was '$GITHUB_EVENT_NAME'." - exit -elif [ "$IS_SNAPSHOT" == "" ]; then +if [ "$IS_SNAPSHOT" == "" ]; then echo >&2 "Skipping build. Given build doesn't appear to be a SNAPSHOT release." else - env TERMINAL=dumb "$BASEDIR/gradlew" uploadArchives + env TERMINAL=dumb "$BASEDIR/gradlew" publish fi