I'm setting up react-native build in AppCenter.
Everything works on test projects, but in a real repository I'm facing the following issue:
For best performance, the analysis is currently limited to four directory levels including the root of your repository.
(Quote from official docs)
My package.json is 2 levels deep (/folder1/folder2/package.json), so build.gradle is located 5 levels deep (/folder1/folder2/android/app/build.gradle).
So when I set up the build in AppCenter I'm able to specify the Project field (pointing to my package.json), but Build Variant combobox is empty.
Is there any solution for that? Can I specify Build Variant manually?
P.S. If I simply move the project one folder above - everything works fine. But I can't do that in my monorepository.
The workaround we are currently using: we created a separate repo with 1-level less nesting, and I'm copying my folder to another repo on each push (via TeamCity).
So, having a repo structure like this:
project
│───frontend
│ └───shared
│ └───web
│ └───react-native
│ │ package.json --> this is the folder we want to build in AppCenter
│ │ ...
│
└───backend
└── somefile.cs
We set up git-hooks to copy the frontend folder to another repo:
root
└───shared
└───web
└───react-native
│ package.json --> this is the folder we want to build in AppCenter
│ ...
So we got one level less deep repository which is ok for AppCenter.
Related
I am trying to build a native Android project that requires Boost library. I have built Boost for the platforms I am targeting using this git project. But for some reason find_package() for Boost fails to find the Boost header paths
Below is the project structure and for the Android app, and location where I have placed the Boost library.
android_app
├── src
│ └──<folder>
│ └──<folder>
│ └──CMakeLists.txt
└── lib
└── boost_armeabi-v7a
├── include
│ └── boost_1_68_0
│ └──boost
│ ├──align.hpp
│ ├──......
│ └──config.hpp
└── lib
├──libboost_atomic.a
├──......
└──libboost_wserialization.a
In the CMake file I have configured like this
set(Boost_NO_SYSTEM_PATHS ON)
set(Boost_NO_BOOST_CMAKE ON)
set(LOCAL_LIB_DIR "${PROJECT_SOURCE_DIR}/../../../lib")
set(Boost_ADDITIONAL_VERSIONS "1.68.0")
set(BOOST_INCLUDEDIR "${LOCAL_LIB_DIR}/boost_${ANDROID_ABI}/include")
set(BOOST_LIBRARYDIR "${LOCAL_LIB_DIR}/boost_${ANDROID_ABI}/lib")
find_package(Boost REQUIRED)
Below error is the error iam getting with find_package.
Unable to find the Boost header files. Please set BOOST_ROOT to the root
directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost's headers.
I added some message statements and finally narrowed down to this piece of code in the FindBoost CMake file (3.10.2) installed from Android Studio
find_path(Boost_INCLUDE_DIR
NAMES boost/config.hpp
HINTS ${_boost_INCLUDE_SEARCH_DIRS}
PATH_SUFFIXES ${_boost_PATH_SUFFIXES}
)
Dumping there variables, one of the combination for {_boost_INCLUDE_SEARCH_DIRS}/{_boost_PATH_SUFFIXES} should be valid for my path, but after this executes, Boost_INCLUDE_DIR is set as NOTFOUND. I have no idea why this fails.
One of the _boost_INCLUDE_SEARCH_DIRS value is /home/<user>/<path-to-repo>/app/lib/boost_armeabi-v7a/include and one of value in PATH_SUFFIXES is boost_1_68_0. Can some one help me figure out why this is failing?
We have a multi-module android project, which we began to refactor to a kotlin-multiplatform project with several modules to share with our iOS app.
Our multiplatform project currently has 4 modules: domain, presentation, data and shared-app. The shared-app module depends on the other three modules and this is the module which is imported into the old android project. We merge the modules into a single one to generate only a single Framework for the iOS project.
Both projects build sucessfully. But if we retrieve an interface instance which is defined in the shared-app module which uses types from the submodules, the IDE shows [ERROR : SomeType] for its return types.
In our old android projects settings.gradle, we used includeBuild(mpp-project) and created a dependency substitution for the shared-app module in the mpp-project.
enableFeaturePreview("GRADLE_METADATA")
includeBuild("mpp-project") {
dependencySubstitution {
substitute(module("our.package.name:shared")).with(project(":shared-app"))
}
}
On the other hand, all of our exposed and transitively imported type can be instantiated in the old android project, even from the submodules. (for example I can instatiate SomeType and it resolves)
Gradle project structure:
oldAndroidRootProject
├─myApp (import implementation of all androidModules and mppFramework)
│ └─build.gradle
├─androidModule1
│ └─build.gradle
├─androidModule2
│ └─build.gradle
├─androidModule3
│ └─build.gradle
│
├─myMppRootProject
│ ├─mppFramework (depends on mppModuleXs and dependencies are declared as api(":mppModuleX"))
│ │ └─build.gradle
│ ├─mppModule1
│ │ └─build.gradle
│ ├─mppModule2
│ │ └─build.gradle
│ ├─mppModule3
│ │ └─build.gradle
│ ├─mppModule4
│ │ └─build.gradle
│ ├─build.gradle
│ └─settings.gradle (uses includeBuild("myMppRootProject"))
├─build.gradle
└─settings.gradle (uses includeBuild("myMppRootProject"))
If I check the mppFramework modules source, when the androidRoot project was opened I see this:
If I can paraphrase:
-------
- ios -
-------
|
----------
- shared - ---------
---------- \
| \ \
-------- ---------- ----------------
- data - - domain - - presentation -
-------- ---------- ----------------
If shared is the single point of entry, it should expose the dependent types through the header. The tricky part of this kind of stuff is when you want something from, say, domain, that isn't included in a public call in shared. If that's not the case, what you're doing should work.
It would be helpful if you posted the build config, so we can see how dependencies are configured. Also, does this work on the command line? Sometimes the IDE isn't working but the build is OK.
Also, is this Intellij or Android Studio, and what version? Intellij tends to be more up-to-date with regards to KMP.
fastlane supply android metadata has the following structure:
└── fastlane
└── metadata
└── android
├── en-US
│ └── changelogs
│ ├── 100000.txt
│ └── 100100.txt
└── fr-FR
└── changelogs
└── 100100.txt
Production builds and versions is changed some times before release so I had to change files names in changelog directories after every build.
I want to have only one "what's new" (changelog) file per locale for the latest build. Something like whats_new.txt
Does fastlane or supply provide such a feature?
supply is not set up to support such a strategy right now, sorry. I think it is a reasonable feature request though. Please submit an issue in our GitHub repository if it's something you'd like to see be possible!
A plugin like changelog might be what you are after. It allows you to pull from one changelog file like so:
read_changelog(
changelog_path: './custom_folder/CHANGELOG.md', # Specify path to CHANGELOG.md
section_identifier: '[Unreleased]', # Specify what section to read
excluded_markdown_elements: '["###"]' # Specify which markdown elements should be excluded
)
I do not, however, see builtin support for a per-locale changelog. For reference, the release_notes.txt file and/or function provide the functionality you describe when using fastlane for iOS projects.
I think what you want it's supported nowadays with the default.txt file
https://docs.fastlane.tools/actions/supply/#changelogs-whats-new
I'm developing an app that is compatible with froyo+ devices and I need to set a theme that is only compatible with API11+ devices but, I cannot fix this cause (obviously) because as soon as I set the Holo.Dark theme the editor gives me an error about its compatibility. I know that I need those (only one of them) folder and their style.xml files to fix this issue but Android Studio doesn't generate those folder. I am wondering if I need to create all those folders and styles.xml files to do the trick or if there is a real workaround to this?
The current files tree is this
├───res
│ ├───drawable-hdpi
│ ├───drawable-mdpi
│ ├───drawable-xhdpi
│ ├───drawable-xxhdpi
│ ├───layout
│ ├───menu
│ ├───values
│ ├───values-w820dp
If you are using Android studio, right click res in your project, then New->Android resource file, and select the resource type: Values, and you can select size, region and others properties at left side.
I have the same problem on Android Studio.
after I create new folder "values-v11", it doesn't show in Android Studio.
you should open this folder in Explore and add *.xml file to this folder then the *.xml file will show in Android Studio in the "values" folder
I'm trying to switch to Android Studio and Gradle, but I have quite some issues with both integration into Studio and build with Gradle.
I've got an app that relies on several libraries.
I'd like to use Android Studio, and Gradle build system.
I'm using git
Most of my libraries are directly git cloned from their github location
Currently, what I have is:
Main Project
├── GH Lib 1
│ ├── <some stuff from the lib>
│ └── library
│ ├── AndroidManifest.xml
│ ├── res
│ └── src
├── GH Lib 2
│ └── <same structure as the lib 1>
├── GH Lib 3
│ └── <same structure as the lib 1>
│── GH Lib 4
│ └── <same structure as the lib 1>
└── My App folder
└── AndroidManifest.xml
└── res
└── src
└── libs
Each of the 'GH Lib X' directory is the result of a git clone from GitHub (for example: ActionBarSherlock).
'My app folder' contains directly res, src, AndroidManifest.xml, libs (with jars), etc.
1st question
I would like to understand how I can integrate all of this in Studio, with Gradle. Currently each lib is a module, and contains a build.gradle file. My App contains also a build.gradle file, however I can't reference dependencies from other folders, because they are in the parent folder, and this AFAIK can't be done with Gradle.
Would this structure be better?
My App Folder
│── AndroidManifest.xml
│── res
│── src
│── libs
└── dependencies
│── GH Lib 1
│── GH Lib 2
│── GH Lib 3
│── GH Lib 4
└── My App folder
My second question related to this is integration with git. Currently all libs are git submodules, is it a good idea?
You should look at the multiproject example for the layout attached in the doc.
http://tools.android.com/tech-docs/new-build-system
http://docs.google.com/viewer?a=v&pid=sites&srcid=YW5kcm9pZC5jb218dG9vbHN8Z3g6NDYzNTVjMjNmM2YwMjhhNA
Essentially you want a top level settings.gradle that tie all the pieces together. Ideally they should be in one single git repo to make your life easier. However you probably can use symlink to tie them into a common build repo that contain your top level settings.gradle.
This structure will work just fine. I have a similar structure and everything OK in Ubuntu 13.04 and Android Studio 130.729444.
You should provide settings.gradle file in root project with references (basically it's a relative path) to each module which should be built.
include ':my-app', ':gh-lib-1:library', ':gh-lib-2:library'
Root build.gradle file should contain tasks/configuration which will be common for all projects. More about multi-project setup can be found here: http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Multi-project-setup
Right now your source directories location does not conform to the default Android Studio setup. You can either move your src, res directories or setup sourceSets configuration in your build.gradle. It should be done for each project. More about project structure: http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Configuring-the-Structure
After these steps you may try to import your project to Android Studio by selecting root build.gradle file in the 'Import project' dialog.
It's possible that at first you will be unable to build the project in IDE due to Task 'assemble' not found in root project error. This is a bug in Android Studio. Fortunately, there is a workaround for this - just include task assemble{} in build.gradle files for all 'root' projects.