Coder Social home page Coder Social logo

xsci / wikipedia-ios Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wikimedia/wikipedia-ios

0.0 2.0 0.0 549.09 MB

📱The official Wikipedia iOS app.

Home Page: https://www.mediawiki.org/wiki/Wikimedia_Apps

License: MIT License

Swift 34.85% Ruby 0.52% Makefile 0.05% Objective-C 41.35% C 0.74% C++ 0.07% HTML 18.50% JavaScript 1.80% CSS 1.85% Shell 0.17% PHP 0.09%

wikipedia-ios's Introduction

Wikipedia iOS

The official Wikipedia iOS client.

MIT license

Development Team

The app is primarily being developed by the Wikimedia Foundation's Mobile Apps team. This README provides high-level guidelines for getting started with the project. If you have any questions, comments, or issues, the easiest way to talk to us is joining the #wikimedia-mobile channel on the Freenode IRC server during Eastern and Pacific business hours. We'll also gladly accept any tickets filed against the project in Phabricator.

Building and Running

Minimum Requirements

  • Xcode - The easiest way to get Xcode is from the App Store, but you can also download it from developer.apple.com if you have an AppleID registered with an Apple Developer account.

Run scripts/setup before building & running in Xcode to install all of the required dependencies. This may take a while as it will also compile any code dependencies.

scripts/setup will install:

At this point, you should be able to open Wikipedia.xcodeproject and run the app on the iOS Simulator (using the Wikipedia scheme and target). If you encounter any issues, please don't hesitate to let us know via a bug report or messaging us on IRC in #wikimedia-ios on Freenode.

Development

Guidelines

These are general guidelines rather than hard rules.

Objective-C

Swift

Formatting

We use Xcode's default 4 space indentation and our .clang-format file with the pre-commit hook setup by scripts/setup. Currently, this does not enforce Swift formatting.

Third-party Dependencies

We use Carthage to manage third-party native dependencies and npm for web.

Testing

The Wikipedia scheme is configured to execute the project's iOS unit tests, which can be run using the Cmd+U hotkey or the Product->Test menu bar action.

Event logging

Note: Testing event logging requires labs access to deployment-eventlog05.eqiad.wmflabs

To test event logging:

  • ensure event logging is enabled via Gear icon > Send usage reports

  • select Event Logging Dev Debug scheme in Xcode

  • get the app install id:

    • run app in the simulator
    • pause
    • paste po [WMFEventLoggingService sharedInstance].appInstallID in the Xcode console and copy the resulting string
  • ssh to labs: ssh deployment-eventlog05.eqiad.wmflabs

  • tail the following files (tail keeps stream open and prints last few lines of a file any time it changes) with the app install id and the id of the schema being tested (from MPopov):

    • /srv/log/eventlogging/all-events.log
      • only has events which have been validated against the appropriate schemas
    • /srv/log/eventlogging/client-side-events.log
      • has all incoming events (as raw, encoded URI query strings) regardless of their validity
    • /var/log/eventlogging/[email protected]
    • /var/log/eventlogging/[email protected]
      • if there are any issues with the incoming events or their validation, there will be detailed messages in the two eventlogging-processor@-client-side-XX logs

    Example:

    • tail -f /srv/log/eventlogging/all-events.log | grep "<app install id>" | grep "<schema id>"

Contributing

Covered in the contributing document.

Gerrit

We also maintain a mirror of this repository on Gerrit (see above), syncing the code after every release. If you'd rather use Gerrit to send us a patch, you'll need to:

Other Development Dependencies

Certain development and maintenance tasks will require the installation of specific tools. Many of these tools are installable using Homebrew, which is our recommended package manager.

Homebrew and many other tools require the Xcode command line tools, which can be installed by running xcode-select --install on newer versions of OS X. They can also be installed via Xcode or downloaded from the Apple Developer downloads page on older versions of OS X.

Carthage

brew install carthage

We use Carthage as our dependency manager. It is required to build the project. After installing carthage, (or running scripts/setup) you should be able to build & run in Xcode. scripts/carthage_bootstrap is run as a build step by Xcode. Your first build will take a while as the dependencies are built. Subsequent builds will re-use the prebuilt dependencies.

Carthage Troubleshooting

Remove the Carthage and Carthage Cache folders inside of the repo directory. Also remove the org.carthage.CarthageKit and Carthage folders from ~/Library/Caches/. Then, run make deps or build in Xcode.

Manually imported dependencies

HockeySDK is manually imported from their binary release. New binary releases of HockeySDK can be downloaded from https://www.hockeyapp.net/releases/ and copied over the existing version in the Wikipedia/Frameworks folder. We use the release in the HockeySDKCrashOnly folder.

Clang-Format

brew install clang-format

As mentioned in best practices and coding style, we use clang-format to lint the project's Objective-C code. Installation via Homebrew is straightforward: brew install clang-format. We use a pre-commit hook to format code. The pre commit hook is scripts/clang_format_diff and is installed by scripts/setup.

NPM

brew install npm

npm is a package manager for nodejs. With it, we install various node modules as Javascript dependencies and development tools (see www/package.json for an up-to-date list). Similar to our native dependencies, we have committed certain files to the repository to remove node and npm as build dependencies in an effort to streamline typical application development. Please see Wikipedia iOS Web Development for more information about how to work with the web components in this project.

Fastlane

fastlane automates common development tasks - for example bumping version numbers, running tests on multiple configurations, or submitting to the App Store. You can list the available lanes (our project-specific scripts) using bundle exec fastlane lanes. You can list available actions (all actions available to be scripted via lanes) using bundle exec fastlane actions. The fastlane configuration and scripts are in the fastlane folder.

Production Builds

For production builds, should ensure you have the DELIVER_USER (your Apple ID) and HOCKEY_PRODUCTION (Wikimedia's HockeyApp API token) environment variables set.

Continuous Integration

Tests are run on Jenkins in response to pull requests. Volunteer contributor pull requests require an ok to test comment on the pull request from a project admin before tests are run.

wikipedia-ios's People

Contributors

joewalsh avatar montehurd avatar coreyfloyd avatar bgerstle avatar wmf-apps-ci avatar amrox avatar translatewiki avatar bvibber avatar josve05a avatar dr0ptp4kt avatar niedzielski avatar ndis1 avatar nirzar avatar berndsi avatar julienbodet avatar barbaramartina avatar mdholloway avatar huayu0723 avatar deskana avatar kellyroach avatar michalciurus avatar waffleboot avatar hhanke avatar gabicoware avatar logan-keller avatar gianmarcosalerno avatar siebrand avatar aclaussen1 avatar anirudh24seven avatar emoudahi avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.