Skip to content

Commit

Permalink
Add annotations lib
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerjroach committed Mar 3, 2023
1 parent 6e71778 commit 64d6572
Show file tree
Hide file tree
Showing 11 changed files with 79 additions and 6 deletions.
1 change: 1 addition & 0 deletions annotations/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
46 changes: 46 additions & 0 deletions annotations/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.
*/

plugins {
id("com.android.library")
id("kotlin-android")
}

apply(from = rootProject.file("configuration/checkstyle.gradle"))
apply(from = rootProject.file("configuration/publishing.gradle"))

group = properties["POM_GROUP"].toString()

android {
kotlinOptions {
moduleName = "com.amplifyframework.annotations"
}
}

dependencies {
implementation(dependency.kotlin.stdlib)
}

afterEvaluate {
// Disables this warning:
// warning: listOf(classfile) MethodParameters attribute
// introduced in version 52.0 class files is ignored in
// version 51.0 class files
// Root project has -Werror, so this warning
// would fail the build, otherwise.
tasks.withType<JavaCompile>().configureEach {
options.compilerArgs.add("-Xlint:-classfile")
}
}
4 changes: 4 additions & 0 deletions annotations/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
POM_ARTIFACT_ID=annotations
POM_NAME=Amplify Framework for Android - Annotations
POM_DESCRIPTION=Amplify Framework for Android - Annotations for AWS Amplify Libraries
POM_PACKAGING=aar
20 changes: 20 additions & 0 deletions annotations/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License").
You may not use this file except in compliance with the License.
A copy of the License is located at
http://aws.amazon.com/apache2.0
or in the "license" file accompanying this file. This file 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.
-->

<manifest package="com.amplifyframework.annotations"
xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,7 @@
* permissions and limitations under the License.
*/

package com.amplifyframework.core
package com.amplifyframework.annotations

/**
* API marked with this annotation is internal to Amplify, and it is not intended to be used outside.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
*/
package com.amplifyframework.auth

import com.amplifyframework.annotations.InternalApiWarning
import com.amplifyframework.auth.result.AuthSessionResult
import com.amplifyframework.core.InternalApiWarning

@InternalApiWarning
open class AWSAuthSessionInternal(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
package com.amplifyframework.auth

import aws.smithy.kotlin.runtime.auth.awscredentials.CredentialsProvider
import com.amplifyframework.annotations.InternalApiWarning
import com.amplifyframework.core.Consumer
import com.amplifyframework.core.InternalApiWarning

@InternalApiWarning
interface AuthCredentialsProvider : CredentialsProvider {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
import androidx.annotation.OptIn;
import androidx.annotation.VisibleForTesting;

import com.amplifyframework.annotations.InternalApiWarning;
import com.amplifyframework.auth.AuthCredentialsProvider;
import com.amplifyframework.auth.CognitoCredentialsProvider;
import com.amplifyframework.core.Consumer;
import com.amplifyframework.core.InternalApiWarning;
import com.amplifyframework.core.NoOpConsumer;
import com.amplifyframework.storage.StorageAccessLevel;
import com.amplifyframework.storage.StorageException;
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ tasks.register<Delete>("clean").configure {
}

val optInAnnotations = listOf(
"com.amplifyframework.core.InternalApiWarning"
"com.amplifyframework.annotations.InternalApiWarning"
)

subprojects {
Expand Down
1 change: 1 addition & 0 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ android {
}

dependencies {
api(project(":annotations"))
implementation(dependency.androidx.v4support)
implementation(dependency.androidx.annotation)
implementation(dependency.androidx.nav.fragment)
Expand Down
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ dependencyResolutionManagement {
}
}

include(":annotations")
include(":core")
include("aws-core")

Expand Down

0 comments on commit 64d6572

Please sign in to comment.