Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e3e25e4d authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

squash

parent 075ce5f8
Loading
Loading
Loading
Loading
Loading

.gitlab-ci.yml

0 → 100644
+176 −0
Original line number Diff line number Diff line
image: "registry.gitlab.e.foundation/e/os/docker-android-apps-cicd:latest"

variables:
  APK_PATH: "app/build/outputs/apk/release"
  UNSIGNED_APK: "app-release.apk"
  COMMUNITY_APK: "Notes_community.apk"
  OFFICIAL_APK: "Notes_official.apk"
  TEST_APK: "Notes_test.apk"

stages:
  - update-from-upstream
  - build
  - gitlab_release

before_script:
  - export GRADLE_USER_HOME=$(pwd)/.gradle
  - chmod +x ./gradlew

cache:
  key: ${CI_PROJECT_ID}
  paths:
  - .gradle/

build:
  stage: build
  variables:
    GIT_SUBMODULE_STRATEGY: recursive
  script:
    - ./gradlew build -x test
  artifacts:
    paths:
      - app/build/outputs/apk/

.update-from-upstream:
  image: registry.gitlab.e.foundation/e/tools/docker-tools:latest
  stage: update-from-upstream
  rules:
    - if: '$CI_PIPELINE_SOURCE == "schedule" && $CI_COMMIT_REF_NAME == $LOCAL_BRANCH'
  variables:
    CI_PROJECT_SSH_URL: git@gitlab.e.foundation:$CI_PROJECT_PATH
    GIT_STRATEGY: none
  before_script:
    - eval $(ssh-agent -s)
    - echo "${SSH_E_ROBOT_PRIVATE_KEY}" | tr -d '\r' | ssh-add -
    - mkdir -p ~/.ssh
    - chmod 700 ~/.ssh
    - echo "${SSH_KNOWN_HOSTS}" > ~/.ssh/known_hosts
    - echo "${SSH_KNOWN_HOSTS}"
    - chmod 644 ~/.ssh/known_hosts
    - git config --global user.email $GITLAB_USER_EMAIL
    - git config --global user.name "$GITLAB_USER_NAME"
    - cd $CI_BUILD_DIR
    - rm -rf $CI_PROJECT_DIR
    - git clone $CI_PROJECT_SSH_URL $CI_PROJECT_DIR
    - cd $CI_PROJECT_DIR
  script:
    - git config --global http.sslverify false
    # update $UPSTREAM_BRANCH & tags
    - git fetch origin
    - git checkout $UPSTREAM_BRANCH
    - git remote add upstream $UPSTREAM_URL
    - git fetch upstream
    - git pull upstream $UPSTREAM_DEFAULT_BRANCH
    - git push origin $UPSTREAM_BRANCH
    - git push origin --tags
    # checkout to latest tag commit to $TEMP_LATEST_TAG_BRANCH
    - git checkout $(git describe --tags --abbrev=0)
    - git checkout -b $TEMP_LATEST_TAG_BRANCH
    # merge $LOCAL_BRANCH with $TEMP_LATEST_TAG_BRANCH & push
    - git checkout $LOCAL_BRANCH
    - git submodule sync
    - git submodule update --init --recursive --force
    - git merge $TEMP_LATEST_TAG_BRANCH
    - git push origin $LOCAL_BRANCH
    # remove unwanted local branch & remote
    - git branch -D $TEMP_LATEST_TAG_BRANCH
    - git remote remove upstream


update-default-branch:
  extends: .update-from-upstream
  variables:
    LOCAL_BRANCH: main
    UPSTREAM_BRANCH: upstream/master
    UPSTREAM_DEFAULT_BRANCH: main
    UPSTREAM_URL: https://github.com/nextcloud/notes-android.git
    TEMP_LATEST_TAG_BRANCH: latest_upstream_tag_branch

init_submodules:
  stage: gitlab_release
  rules:
    - if: '$CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED == "true"'
      when: on_success
  script:
    - git clone https://gitlab.e.foundation/e/os/system-apps-update-info.git systemAppsUpdateInfo
  artifacts:
    paths:
      - systemAppsUpdateInfo/scripts/

generate-apks:
  stage: gitlab_release
  rules:
    - if: '$CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED == "true"'
      when: on_success
  needs:
    - init_submodules
    - build
  dependencies:
    - init_submodules
    - build
  script:
    - |
      ./systemAppsUpdateInfo/scripts/generate-apks.sh \
      "$APK_PATH" "$UNSIGNED_APK" "$COMMUNITY_APK" "$OFFICIAL_APK" "$TEST_APK"
  artifacts:
    paths:
      - $APK_PATH/$UNSIGNED_APK
      - $APK_PATH/$COMMUNITY_APK
      - $APK_PATH/$OFFICIAL_APK
      - $APK_PATH/$TEST_APK

create-json-files:
  stage: gitlab_release
  dependencies:
    - init_submodules
    - generate-apks
  needs:
    - init_submodules
    - generate-apks
  rules:
    - if: '$CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED == "true"'
      when: on_success
  script:
    - |
      ./systemAppsUpdateInfo/scripts/create-json-files.sh \
      "$APK_PATH" "$UNSIGNED_APK" "$COMMUNITY_APK" "$OFFICIAL_APK" "$TEST_APK"
  artifacts:
    paths:
      - community.json
      - official.json
      - test.json

create-test-release:
  stage: gitlab_release
  dependencies:
    - init_submodules
  needs:
    - init_submodules
    - create-json-files
    - generate-apks
  rules:
    - if: '$CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED == "true"'
      when: manual
  script:
    - |
      ./systemAppsUpdateInfo/scripts/create-test-release.sh \
      "$APK_PATH" "$TEST_APK"
  allow_failure: true

create-release:
  stage: gitlab_release
  dependencies:
    - init_submodules
  needs:
    - init_submodules
    - create-json-files
    - generate-apks
  rules:
    - if: '$CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED == "true"'
      when: manual
  script:
    - |
      ./systemAppsUpdateInfo/scripts/create-release.sh \
      "$APK_PATH" "$UNSIGNED_APK" "$COMMUNITY_APK" "$OFFICIAL_APK"
  allow_failure: true
  
 No newline at end of file

AUTHORS

0 → 100644
+4 −0
Original line number Diff line number Diff line
© e Foundation 2018-2019
© ECORP SAS 2018-2019
© MURENA SAS 2022-2023
And all other authors - see https://github.com/nextcloud/notes-android/graphs/contributors
+13 −59
Original line number Diff line number Diff line
# Nextcloud Notes for Android
An android client for [Nextcloud Notes App](https://github.com/nextcloud/notes/).
# Notes
An android client for [Nextcloud Notes App](https://github.com/nextcloud/notes/)  
Notes is forked from [Nextcloud Notes](https://github.com/stefan-niedermann/nextcloud-notes)

[![Android CI](https://github.com/stefan-niedermann/nextcloud-notes/workflows/Android%20CI/badge.svg)](https://github.com/stefan-niedermann/nextcloud-notes/actions)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/9f784826834042e8b512d531cab84711)](https://www.codacy.com/manual/info_147/nextcloud-notes?utm_source=github.com&utm_medium=referral&utm_content=stefan-niedermann/nextcloud-notes&utm_campaign=Badge_Grade)
[![GitHub issues](https://img.shields.io/github/issues/stefan-niedermann/nextcloud-notes.svg)](https://github.com/stefan-niedermann/nextcloud-notes/issues)
[![GitHub stars](https://img.shields.io/github/stars/stefan-niedermann/nextcloud-notes.svg)](https://github.com/stefan-niedermann/nextcloud-notes/stargazers)
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
## Authors

## :arrow_forward: Access
[Authors](https://gitlab.e.foundation/e/apps/Notes/-/blob/master/AUTHORS)

[![Latest Release](https://img.shields.io/github/v/tag/stefan-niedermann/nextcloud-notes?label=latest+release&sort=semver)](https://github.com/stefan-niedermann/nextcloud-notes/tags)
[![F-Droid Release](https://img.shields.io/f-droid/v/it.niedermann.owncloud.notes)](https://f-droid.org/de/packages/it.niedermann.owncloud.notes/)
## Release Notes

[<img src="https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png"
      alt="Get it on Play Store"
      height="80">](https://play.google.com/store/apps/details?id=it.niedermann.owncloud.notes)
[<img src="https://f-droid.org/badge/get-it-on.png"
      alt="Get it on F-Droid"
      height="80">](https://f-droid.org/repository/browse/?fdid=it.niedermann.owncloud.notes)
[<img src="https://raw.githubusercontent.com/stefan-niedermann/paypal-donate-button/master/paypal-donate-button.png"
      alt="Donate with PayPal"
      height="80">](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=K7HVLE6J7SXXA)
[<img src="https://raw.githubusercontent.com/stefan-niedermann/DonateButtons/master/LiberaPay.png"
      alt="Donate using Liberapay"
      height="80">](https://liberapay.com/stefan-niedermann/donate)
Check out the [Release Notes](https://gitlab.e.foundation/e/apps/Notes/-/releases) to find out what changed
in each version of Notes.

## :eyes: Screenshots
## Privacy Policy

| _ | _ | _ |
| :--: | :--: | :--: |
| ![Screenshot of list view](/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png) | ![Screenshot of edit mode](/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png) | ![Screenshot of preview](/fastlane/metadata/android/en-US/images/phoneScreenshots/4.png) |
[Privacy Policy](https://e.foundation/legal-notice-privacy)  
[Terms of service](https://e.foundation/legal-notice-privacy)

## :rocket: Features
  * Multiple accounts
  * List, create, edit, share, search and delete notes
  * Share text and links as new note into the app
  * Toggling checkboxes in view mode
  * Mark notes as favorite
  * Bulk delete
  * In-note search
  * Single note widget and note list widget
  * Render Markdown (using [Markwon](https://noties.io/Markwon))
  * Translated in many languages on [Transifex](https://www.transifex.com/nextcloud/nextcloud/android-notes/)
  * Context based formatting ([#363](https://github.com/stefan-niedermann/nextcloud-notes/issues/363))
  * Password protection ([#354](https://github.com/stefan-niedermann/nextcloud-notes/issues/354))
## License

## :checkered_flag: Roadmap
  * We usually focus on [pinned issues](https://github.com/stefan-niedermann/nextcloud-notes/issues) in our issue tracker
  * Since this is an Open Source freetime project, there is no guarantee when and if and how we implement new features

## :family: Join the team
  * Test the app with different devices
  * Report issues in the [issue tracker](https://github.com/stefan-niedermann/nextcloud-notes/issues)
  * [Pick a good first issue](https://github.com/stefan-niedermann/nextcloud-notes/labels/Good%20first%20issue) :notebook:
  * Create a [Pull Request](https://opensource.guide/how-to-contribute/#opening-a-pull-request)
  * Help translating this app on [Transifex](https://www.transifex.com/nextcloud/nextcloud/android-notes/) 🌎
  * Buy this app on [Google Play Store](https://play.google.com/store/apps/details?id=it.niedermann.owncloud.notes)
  * Send me a bottle of your favorite beer :beers: :wink:

## :link: Requirements
  * [Nextcloud](https://nextcloud.com/) instance running
  * [Nextcloud Android](https://github.com/nextcloud/android) app installed (≥ 3.9.0)
  * [Nextcloud Notes](https://github.com/nextcloud/notes) app enabled

## :notebook: License
This project is licensed under the [GNU GENERAL PUBLIC LICENSE](/LICENSE).
Notes is licensed under the [GNU General Public License v3.0](https://gitlab.e.foundation/e/apps/Notes/-/blob/master/LICENSE)
 No newline at end of file
+2 −1
Original line number Diff line number Diff line
@@ -6,3 +6,4 @@
/dev
/mdm
/pfungstadt
version.properties
+102 −34
Original line number Diff line number Diff line
apply plugin: 'com.android.application'
apply plugin: 'org.jetbrains.kotlin.android'

def buildDate = { ->
    return new Date().format('yyyyMMddHHmmss')
}

def appMajor = 3
def appMinor = 7
def appPatch = 4
def appVersionCode = 3007004

android {
    compileSdkVersion 33
    buildToolsVersion '31.0.0'

    def versionPropsFile = file('version.properties')
    Properties versionProps = new Properties()

    if (!versionPropsFile.exists()) {
        versionProps['VERSION_CHANGE'] = '0'
        versionProps['VERSION_MAJOR'] = appMajor.toString()
        versionProps['VERSION_MINOR'] = appMinor.toString()
        versionProps['VERSION_PATCH'] = appPatch.toString()
        versionProps['VERSION_CODE'] = appVersionCode.toString()
        versionProps.store(versionPropsFile.newWriter(), null)
    }

    def getVersionCode = { ->
        if (versionPropsFile.canRead()) {
            versionProps.load(new FileInputStream(versionPropsFile))
            def versionChange = versionProps['VERSION_CHANGE'].toInteger() + 1
            def versionMinor = versionProps['VERSION_MINOR'].toInteger()
            def versionMajor = versionProps['VERSION_MAJOR'].toInteger()
            def versionPatch = versionProps['VERSION_PATCH'].toInteger()
            // Up version on each 100 cycles of builds
            if (versionChange >= 100) {
                versionPatch = versionProps['VERSION_PATCH'].toInteger() + 1
                versionChange = 0
            }
            if (versionPatch == 9) {
                versionMinor = versionProps['VERSION_MINOR'].toInteger() + 1
                versionPatch = 0
            }
            if (versionMinor == 9) {
                versionMajor = versionProps['VERSION_MAJOR'].toInteger() + 1
                versionMinor = 0
            }
            def versionCode = versionProps['VERSION_CODE'].toInteger()

            versionProps['VERSION_CHANGE'] = versionChange.toString()
            versionProps['VERSION_PATCH'] = versionPatch.toString()
            versionProps['VERSION_MINOR'] = versionMinor.toString()
            versionProps['VERSION_MAJOR'] = versionMajor.toString()
            versionProps['VERSION_CODE'] = (versionCode.toInteger() + 1).toString()
            versionProps.store(versionPropsFile.newWriter(), null)
            return versionCode
        }
    }

    def getVersionName = { ->
        if (versionPropsFile.canRead()) {
            versionProps.load(new FileInputStream(versionPropsFile))

            def versionMajor = versionProps['VERSION_MAJOR']
            def versionMinor = versionProps['VERSION_MINOR']
            def versionPatch = versionProps['VERSION_PATCH']

            return "${versionMajor}.${versionMinor}.${versionPatch}"
        }
    }

    compileOptions {
        coreLibraryDesugaringEnabled true
        sourceCompatibility JavaVersion.VERSION_11
        targetCompatibility JavaVersion.VERSION_11
    }

    signingConfigs {
        platformConfig {
            storeFile file("$rootDir/keystore/platform.jks")
            storePassword 'platform'
            keyAlias 'platform'
            keyPassword 'platform'
        }
    }

    defaultConfig {
        applicationId "it.niedermann.owncloud.notes"
        minSdkVersion 23
        applicationId "foundation.e.notes"
        minSdkVersion 24
        targetSdkVersion 33
        versionCode 3007001
        versionName "3.7.1"
        versionCode getVersionCode()
        versionName getVersionName()
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        javaCompileOptions {
            annotationProcessorOptions {
@@ -31,35 +106,14 @@ android {
    buildTypes {
        debug {
            testCoverageEnabled true
            signingConfig signingConfigs.platformConfig
        }

        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }


    flavorDimensions "version"

    productFlavors {
        fdroid {
            dimension "version"
        }
        dev {
            dimension "version"
            applicationIdSuffix ".dev"
        }
        play {
            dimension "version"
        }
        pfungstadt {
            dimension "version"
            applicationIdSuffix ".pfungstadt"
        }
        mdm {
            dimension "version"
            applicationIdSuffix ".mdm"
            signingConfig signingConfigs.platformConfig
            versionNameSuffix "-${buildDate()}"
        }
    }

@@ -73,23 +127,35 @@ android {
        disable 'MissingTranslation'
    }
    namespace 'it.niedermann.owncloud.notes'
    kotlinOptions {
        jvmTarget = '11'
    }

}

dependencies {
    implementation 'androidx.core:core-ktx:1.10.1'
    coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.6'

    // Nextcloud SSO
    implementation 'com.github.nextcloud:Android-SingleSignOn:0.6.1'
    implementation 'com.github.stefan-niedermann:android-commons:0.2.7'
    implementation 'com.github.stefan-niedermann.nextcloud-commons:sso-glide:1.6.4'
    implementation 'com.github.stefan-niedermann.nextcloud-commons:exception:1.6.4'
    implementation 'foundation.e.lib:Android-SingleSignOn:1.0.8-release'
    implementation ('com.github.stefan-niedermann:android-commons:0.2.7') {
        exclude group: 'com.github.nextcloud', module: 'Android-SingleSignOn'
    }
    implementation ('com.github.stefan-niedermann.nextcloud-commons:exception:1.6.4') {
        exclude group: 'com.github.nextcloud', module: 'Android-SingleSignOn'
    }
    implementation('com.github.stefan-niedermann.nextcloud-commons:markdown:1.6.4') {
        exclude group: 'org.jetbrains', module: 'annotations-java5'
        exclude group: 'com.github.nextcloud', module: 'Android-SingleSignOn'
    }
    implementation ('com.github.stefan-niedermann.nextcloud-commons:sso-glide:2.1.0') {
        exclude group: 'com.github.nextcloud', module: 'Android-SingleSignOn'
    }

    // Glide
    implementation 'com.github.bumptech.glide:glide:4.14.2'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.14.2'
    implementation 'com.github.bumptech.glide:glide:4.16.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.16.0'

    // Android X
    implementation 'androidx.appcompat:appcompat:1.5.1'
@@ -124,4 +190,6 @@ dependencies {
    testImplementation 'org.robolectric:robolectric:4.9'

    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'foundation.e:elib:0.0.1-alpha11'
    implementation 'co.trikita:log:1.1.5'
}
Loading