Skip to content
This repository has been archived by the owner on Jul 4, 2018. It is now read-only.

Commit

Permalink
Merge pull request j2objc-contrib#344 from brunobowden/fixup
Browse files Browse the repository at this point in the history
Can I develop on Windows - FAQ new item
  • Loading branch information
brunobowden committed Aug 14, 2015
2 parents 88c386e + c2299c1 commit 4fecf27
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 1 deletion.
16 changes: 16 additions & 0 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,19 @@ source and whitelist. Note how this gives and expected cycles of zero.
For more details:
- http://j2objc.org/docs/Cycle-Finder-Tool.html
- https://groups.google.com/forum/#!msg/j2objc-discuss/2fozbf6-liM/R83v7ffX5NMJ


### Can I develop on Windows?

Development is officially supported only on Mac OS X. This matches the
[J2ObjC Requirements](http://j2objc.org/#requirements).
In practice, the j2objcCycleFinder and j2objcTranslate tasks may work, though it is
strongly suggested to use this for experimentation only and do all proper development
on OS X. The team will reject any bugs related to systems that don't meet the
[minimum requirements](README.md#minimum-requirements).

To experiment on Windows (skipping the unsupported tasks), the following may work:

./gradlew shared:j2objcAssembleSource shared:j2objcAssembleResources

Please note that this will not build the packed libraries or update your Xcode project.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,18 @@ Within the Android application's `android/build.gradle`, make it dependent on th
}


### Minimum Requirements

Gradle 2.4 is required for the compilation support within Gradle. The other necessities
are the [J2objc Requirements](http://j2objc.org/#requirements).

* Gradle 2.4
* JDK 1.7 or higher
* Mac workstation or laptop
* Mac OS X 10.9 or higher
* Xcode 6 or higher


### J2ObjC Installation

Download the latest version from the [J2ObjC Releases](https://github.com/google/j2objc/releases).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import com.github.j2objccontrib.j2objcgradle.tasks.TranslateTask
import com.github.j2objccontrib.j2objcgradle.tasks.Utils
import com.github.j2objccontrib.j2objcgradle.tasks.XcodeTask
import org.gradle.api.DefaultTask
import org.gradle.api.InvalidUserDataException
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.Task
Expand All @@ -43,6 +44,11 @@ class J2objcPlugin implements Plugin<Project> {
project.with {
Utils.checkMinGradleVersion(GradleVersion.current())

if (Utils.isWindows()) {
logger.warn('Windows is officially unsupported:\n' +
'https://github.com/j2objc-contrib/j2objc-gradle/blob/master/FAQ.md#can-i-develop-on-windows')
}

extensions.create('j2objcConfig', J2objcConfig, project)

afterEvaluate { Project evaluatedProject ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package com.github.j2objccontrib.j2objcgradle.tasks
import com.github.j2objccontrib.j2objcgradle.J2objcConfig
import groovy.transform.CompileStatic
import org.gradle.api.DefaultTask
import org.gradle.api.InvalidUserDataException
import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputFiles
Expand Down Expand Up @@ -60,6 +61,12 @@ class PackLibrariesTask extends DefaultTask {
Utils.projectDelete(project, getOutputLibDirFile())
getOutputLibDirFile().mkdirs()

if (Utils.isWindows()) {
throw new InvalidUserDataException(
'Windows is officially unsupported. The packLibraries task can only be run on Mac OS X:\n' +
'https://github.com/j2objc-contrib/j2objc-gradle/blob/master/FAQ.md#can-i-develop-on-windows')
}

ByteArrayOutputStream stdout = new ByteArrayOutputStream()
ByteArrayOutputStream stderr = new ByteArrayOutputStream()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class TestTask extends DefaultTask {
" testMinExpectedTests ${testCount}\n" +
"}\n"
if (getTestMinExpectedTests() == 0) {
logger.warn "Min Test check disabled due to: 'testMinExpectedTests 0'"
logger.warn("Min Test check disabled due to: 'testMinExpectedTests 0'")
} else if (testCount < getTestMinExpectedTests()) {
if (testCount == 0) {
message =
Expand Down

0 comments on commit 4fecf27

Please sign in to comment.