Skip to content

Commit

Permalink
Merge pull request #5 from zeoflow/initial-deploy
Browse files Browse the repository at this point in the history
Files Created
  • Loading branch information
teogor authored Oct 2, 2020
2 parents 443b20d + 28b5cfe commit ca81e5d
Show file tree
Hide file tree
Showing 227 changed files with 20,583 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
/.idea

*.iml
anidero/anidero.gpg
21 changes: 21 additions & 0 deletions android-wait-for-emulator
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
set +e

bootanim=""
failcounter=0
timeout_in_sec=360

until [[ "$bootanim" =~ "stopped" ]]; do
bootanim=`adb -e shell getprop init.svc.bootanim 2>&1 &`
if [[ "$bootanim" =~ "device not found" || "$bootanim" =~ "device offline"
|| "$bootanim" =~ "running" ]]; then
let "failcounter += 1"
echo "Waiting for emulator to start"
if [[ $failcounter -gt timeout_in_sec ]]; then
echo "Timeout ($timeout_in_sec seconds) reached; failed to start emulator"
exit 1
fi
fi
sleep 1
done

echo "Emulator is ready"
1 change: 1 addition & 0 deletions anidero/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
46 changes: 46 additions & 0 deletions anidero/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode rootProject.ext.versionCode
versionName rootProject.ext.versionName
vectorDrawables.useSupportLibrary = true
}
lintOptions {
abortOnError true
textReport true
textOutput 'stdout'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
testOptions {
unitTests {
includeAndroidResources = true
}
}
}

dependencies {

implementation androidx.appcompat
implementation androidx.browser
implementation androidx.cardview
implementation androidx.constraintlayout
implementation androidx.exifinterface
implementation androidx.recyclerview
implementation androidx.transition

implementation 'com.squareup.okio:okio:2.6.0'
annotationProcessor "com.uber.nullaway:nullaway:0.7.5"
}

apply from: "${rootProject.projectDir}/anidero/maven-push.gradle"
repositories {
mavenCentral()
}
26 changes: 26 additions & 0 deletions anidero/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
POM_NAME=Anidero
POM_ARTIFACT_ID=anidero
POM_PACKAGING=aar

VERSION_NAME=1.0.0
VERSION_CODE=1
GROUP=com.zeoflow

POM_DESCRIPTION=An Android Library that renders After Effects animations in JSON format
POM_URL=https://github.com/zeoflow/anidero
POM_SCM_URL=https://github.com/zeoflow/anidero
POM_SCM_CONNECTION=scm:git@github.com:zeoflow/anidero.git
POM_SCM_DEV_CONNECTION=scm:git@github.com:zeoflow/anidero.git
POM_LICENCE_NAME=The Apache Software License, Version 2.0
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=zeoflow
POM_DEVELOPER_NAME=ZeoFlow

org.gradle.daemon=true

NEXUS_USERNAME=
NEXUS_PASSWORD=
signing.keyId=
signing.password=
signing.secretKeyRingFile=
103 changes: 103 additions & 0 deletions anidero/maven-push.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/*
* Copyright 2020 ZeoFlow
*
* 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: 'maven'
apply plugin: 'signing'

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('NEXUS_USERNAME') ? NEXUS_USERNAME : ""
}

def getRepositoryPassword() {
return hasProperty('NEXUS_PASSWORD') ? 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_LICENCE_NAME
url POM_LICENCE_URL
distribution POM_LICENCE_DIST
}
}

developers {
developer {
id POM_DEVELOPER_ID
name POM_DEVELOPER_NAME
}
}
}
}
}
}

signing {
required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}

task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.sourceFiles
}

artifacts {
archives androidSourcesJar
}
}
5 changes: 5 additions & 0 deletions anidero/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<manifest package="com.zeoflow.anidero" >

<application />

</manifest>
64 changes: 64 additions & 0 deletions anidero/src/main/java/com/zeoflow/anidero/Anidero.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package com.zeoflow.anidero;

import androidx.annotation.RestrictTo;
import androidx.core.os.TraceCompat;

@RestrictTo(RestrictTo.Scope.LIBRARY)
public class Anidero
{

public static boolean DBG = false;
public static final String TAG = "ANIDERO";

private static final int MAX_DEPTH = 20;
private static boolean traceEnabled = false;
private static String[] sections;
private static long[] startTimeNs;
private static int traceDepth = 0;
private static int depthPastMaxDepth = 0;

public static void setTraceEnabled(boolean enabled) {
if (traceEnabled == enabled) {
return;
}
traceEnabled = enabled;
if (traceEnabled) {
sections = new String[MAX_DEPTH];
startTimeNs = new long[MAX_DEPTH];
}
}

public static void beginSection(String section) {
if (!traceEnabled) {
return;
}
if (traceDepth == MAX_DEPTH) {
depthPastMaxDepth++;
return;
}
sections[traceDepth] = section;
startTimeNs[traceDepth] = System.nanoTime();
TraceCompat.beginSection(section);
traceDepth++;
}

public static float endSection(String section) {
if (depthPastMaxDepth > 0) {
depthPastMaxDepth--;
return 0;
}
if (!traceEnabled) {
return 0;
}
traceDepth--;
if (traceDepth == -1) {
throw new IllegalStateException("Can't end trace section. There are none.");
}
if (!section.equals(sections[traceDepth])) {
throw new IllegalStateException("Unbalanced trace call " + section +
". Expected " + sections[traceDepth] + ".");
}
TraceCompat.endSection();
return (System.nanoTime() - startTimeNs[traceDepth]) / 1000000f;
}
}
Loading

0 comments on commit ca81e5d

Please sign in to comment.