Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Commit

Permalink
feat: config yoga android (#10)
Browse files Browse the repository at this point in the history
* config project yoga android

* adjust git

* remove local propertiesx

* beagle yoga

* adjust version soloader

* adjust fastlane

* adjust workflow release

* remove workflow ci

* adjust workflow

* temporary deploy

* current branch

* adjust workflow

* adjust workflow

* adjust publish

* adjust workflow release

* remove gem file lock

Co-authored-by: Uzias Ferreira <[email protected]>
  • Loading branch information
uziasferreirazup and uziassantosferreira authored May 11, 2021
1 parent 4f125e4 commit ed60928
Show file tree
Hide file tree
Showing 125 changed files with 312 additions and 699 deletions.
56 changes: 0 additions & 56 deletions .github/workflows/ci.yml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Beagle Release

on:
workflow_run:
workflows: [ "Beagle Yoga Release" ]
types:
- completed
jobs:
generate-release:
name: Generate release
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Read secrets from AWS Secrets Manager into environment variables
uses: abhilash1in/[email protected]
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
secrets: |
beagle/core/*
parse-json: true
- name: Install Fastlane
run: bundle install
- name: Deploy new version
env:
REPO_TOKEN: ${{ env.BEAGLE_CORE_GITHUB_GITHUB_TOKEN }}
NAME_REPO_TOKEN: ${{ env.BEAGLE_CORE_GITHUB_GITHUB_USER }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ env.BEAGLE_CORE_ARTIFACT_SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ env.BEAGLE_CORE_ARTIFACT_SONATYPE_NEXUS_PASSWORD }}
GPG_KEY_CONTENTS: ${{ env.BEAGLE_CORE_ARTIFACT_GPG_KEY_CONTENTS }}
ORG_GRADLE_PROJECT_SIGNINGKEYID: ${{ env.BEAGLE_CORE_ARTIFACT_ORG_GRADLE_PROJECT_SIGNINGKEYID }}
ORG_GRADLE_PROJECT_SIGNINGPASSWORD: ${{ env.BEAGLE_CORE_ARTIFACT_ORG_GRADLE_PROJECT_SIGNINGPASSWORD }}
GITHUB_USER: ${{ env.BEAGLE_CORE_GITHUB_GITHUB_USER }}
GITHUB_TOKEN: ${{ env.BEAGLE_CORE_GITHUB_GITHUB_TOKEN }}
run: bundle exec fastlane android deploy_to_production
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,9 @@ Carthage/Build
.gradle
# NDK/CMake
.externalNativeBuild


**/.idea/*
**/.cxx/*
local.properties
Gemfile.lock
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source 'https://rubygems.org'

gem 'fastlane'

plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
25 changes: 1 addition & 24 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@
* 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'
apply from: new File('./../maven-publish.gradle')

version = VERSION_NAME
group = GROUP

android {
compileSdkVersion rootProject.compileSdkVersion
Expand All @@ -31,22 +27,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')
8 changes: 2 additions & 6 deletions android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,5 @@
# This source code is licensed under the MIT license found in the LICENSE
# file in the root directory of this source tree.
#

GROUP=com.facebook.yoga.android
POM_NAME=YogaLayout
POM_DESCRIPTION=YogaLayout
POM_ARTIFACT_ID=yoga-layout
POM_PACKAGING=aar
POM_ARTIFACT_ID=beagle-yoga-layout
POM_NAME=beagle-yoga-layout
7 changes: 1 addition & 6 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!--
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.
-->
Expand All @@ -13,11 +13,6 @@
android:versionName="1.0"
>

<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="21"
/>

<application/>

</manifest>
22 changes: 0 additions & 22 deletions android/src/main/java/com/facebook/yoga/android/BUCK

This file was deleted.

70 changes: 34 additions & 36 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,64 +8,62 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
google()
jcenter()
maven { url 'https://maven.google.com/' }
}
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'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
repositories {
google()
mavenCentral()
maven { url 'https://maven.google.com/' }
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.0'
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.15.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}

ext {
minSdkVersion = 14
targetSdkVersion = 25
compileSdkVersion = 26
buildToolsVersion = '28.0.3'
sourceCompatibilityVersion = JavaVersion.VERSION_1_7
targetCompatibilityVersion = JavaVersion.VERSION_1_7
minSdkVersion = 19
targetSdkVersion = 30
compileSdkVersion = 30
buildToolsVersion = '30.0.3'
sourceCompatibilityVersion = JavaVersion.VERSION_1_8
targetCompatibilityVersion = JavaVersion.VERSION_1_8
}

// If you have an idea on how to avoid this, please get in touch or
// answer https://stackoverflow.com/questions/43867014/how-to-use-the-gradle-ndk-build-to-compile-for-the-host-machine.
task copyNativeLibs(type: Copy, dependsOn: ':buckBuildNative') {
from "${rootDir}/buck-out/gen/java/tests#default,shared-library-symlink-tree/"
include '*.so'
include '*.dylib'
into "$buildDir/jniLibs"
from "${rootDir}/buck-out/gen/java/tests#default,shared-library-symlink-tree/"
include '*.so'
include '*.dylib'
into "$buildDir/jniLibs"
}

task buckBuildNative(type: Exec) {
workingDir rootDir
environment BUCKVERSION: 'last'
commandLine 'buck', 'build', '//java/...'
workingDir rootDir
environment BUCKVERSION: 'last'
commandLine 'buck', 'build', '//java/...'
}

allprojects {
afterEvaluate {
tasks.withType(Test) {
dependsOn copyNativeLibs
def libDir = "${rootDir}/build/jniLibs"
systemProperty 'java.library.path', libDir
environment 'LD_LIBRARY_PATH', libDir
environment 'DYLD_LIBRARY_PATH', libDir
}
afterEvaluate {
tasks.withType(Test) {
dependsOn copyNativeLibs
def libDir = "${rootDir}/build/jniLibs"
systemProperty 'java.library.path', libDir
environment 'LD_LIBRARY_PATH', libDir
environment 'DYLD_LIBRARY_PATH', libDir
}
}
}

task clean(type: Delete) {
delete rootProject.buildDir
delete rootProject.buildDir
}
2 changes: 2 additions & 0 deletions fastlane/Appfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
json_key_file("") # Path to the json secret file - Follow https://docs.fastlane.tools/actions/supply/#setup to get one
package_name("") # e.g. com.krausefx.app
19 changes: 19 additions & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
###
### Android
###

platform :android do

desc "Deploy current code to stage"
lane :deploy_to_stage do
gradle(task: "assemble")
gradle(task: "uploadArchives --no-daemon --no-parallel")
gradle(task: "closeAndReleaseRepository")
end

desc "Deploy current code to production"
lane :deploy_to_production do
sh "bash ./release/maven_signing.sh"
deploy_to_stage
end
end
3 changes: 3 additions & 0 deletions fastlane/Pluginfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Autogenerated by fastlane
#
# Ensure this file is checked in to source control!
34 changes: 34 additions & 0 deletions fastlane/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
fastlane documentation
================
# Installation

Make sure you have the latest version of the Xcode command line tools installed:

```
xcode-select --install
```

Install _fastlane_ using
```
[sudo] gem install fastlane -NV
```
or alternatively using `brew install fastlane`

# Available Actions
## Android
### android deploy_to_stage
```
fastlane android deploy_to_stage
```
Deploy current code to stage
### android deploy_to_production
```
fastlane android deploy_to_production
```
Deploy current code to production

----

This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run.
More information about fastlane can be found on [fastlane.tools](https://fastlane.tools).
The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools).
20 changes: 20 additions & 0 deletions fastlane/release/maven_signing.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

create_gradle_properties() {
KEYID=$1
PASSWORD=$2
GPG_KEY_CONTENTS=$3
GPG_LOCATION=~/.gradle/release.gpg
GRADLE_PROPERTIES_LOCATION=~/.gradle/gradle.properties

mkdir -p ~/.gradle

rm -f $GPG_LOCATION
rm -f $GRADLE_PROPERTIES_LOCATION

echo $GPG_KEY_CONTENTS | base64 -d > $GPG_LOCATION

printf "signing.keyId=$KEYID\nsigning.password=$PASSWORD\nsigning.secretKeyRingFile=$GPG_LOCATION\n" >> $GRADLE_PROPERTIES_LOCATION
}

create_gradle_properties $ORG_GRADLE_PROJECT_SIGNINGKEYID $ORG_GRADLE_PROJECT_SIGNINGPASSWORD $GPG_KEY_CONTENTS
Loading

0 comments on commit ed60928

Please sign in to comment.