Skip to content

Commit

Permalink
Fix examples, templates (#2359)
Browse files Browse the repository at this point in the history
- move screenshot into screenshots folder
- add Readme, run configuration, .gitignore to web-template
- fix web-compose-in-js (read versions from properties)
- add global idea/ into gitignore
  • Loading branch information
igordmn authored Oct 5, 2022
1 parent 521e29d commit 7bd0b3d
Show file tree
Hide file tree
Showing 40 changed files with 69 additions and 27 deletions.
8 changes: 1 addition & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@ out
*.iml
.gradle
/local.properties
/.idea
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.idea/
.DS_Store
build/
/captures
Expand Down
2 changes: 1 addition & 1 deletion examples/codeviewer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ MPP Code Viewer example for desktop/android written in Multiplatform Compose lib

* To run, launch command: `./gradlew :desktop:run`
* Or choose **desktop** configuration in IDE and run it.
![desktop-run-configuration.png](desktop-run-configuration.png)
![desktop-run-configuration.png](screenshots/desktop-run-configuration.png)

### Building native desktop distribution
```
Expand Down
2 changes: 1 addition & 1 deletion examples/falling-balls/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ Falling Balls game
### Running desktop application
* To run, launch command: `./gradlew run`
* Or choose **desktop** configuration in IDE and run it.
![desktop-run-configuration.png](desktop-run-configuration.png)
![desktop-run-configuration.png](screenshots/desktop-run-configuration.png)

2 changes: 1 addition & 1 deletion examples/imageviewer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ An example of image gallery for remote server image viewing, based on Jetpack Co
### Running desktop application
* To run, launch command: `./gradlew :desktop:run`
* Or choose **desktop** configuration in IDE and run it.
![desktop-run-configuration.png](desktop-run-configuration.png)
![desktop-run-configuration.png](screenshots/desktop-run-configuration.png)

### Building native desktop distribution
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ and allows sharing Compose runtime between multiple plugins
1. Start test IDE:
* Run the following command in terminal: `./gradlew runIde`
* Or choose **runIde** configuration in IDE and run it.
![ide-run-configuration.png](ide-run-configuration.png)
![ide-run-configuration.png](screenshots/ide-run-configuration.png)
2. Create a new project or open any existing;
3. Select `Show Compose Demo...` from the `Tools` menu.

Expand Down
2 changes: 1 addition & 1 deletion examples/intellij-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ To run the example:
1. from directory `compose-jb/examples/intellij-plugin`:
* Run command in terminal `./gradlew runIde`.
* Or choose **runIde** configuration in IDE and run it.
![ide-run-configuration.png](ide-run-configuration.png)
![ide-run-configuration.png](screenshots/ide-run-configuration.png)
2. create project or open any existing
3. from menu `Tools` select `Show Compose Demo...`

Expand Down
2 changes: 1 addition & 1 deletion examples/issues/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Github Issues viewer example written in Jetpack Compose UI library.
### Running desktop application
* To run, launch command: `./gradlew :desktop:run`
* Or choose **desktop** configuration in IDE and run it.
![desktop-run-configuration.png](desktop-run-configuration.png)
![desktop-run-configuration.png](screenshots/desktop-run-configuration.png)

### Building native desktop distribution
```
Expand Down
2 changes: 1 addition & 1 deletion examples/notepad/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Notepad example for desktop written in Compose for Desktop library, using Compos
### Running desktop application
* To run, launch command: `./gradlew run`
* Or choose **desktop** configuration in IDE and run it.
![desktop-run-configuration.png](desktop-run-configuration.png)
![desktop-run-configuration.png](screenshots/desktop-run-configuration.png)

### Building native desktop distribution
```
Expand Down
2 changes: 1 addition & 1 deletion examples/todoapp-lite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Supported targets: Android and Desktop.
### Running desktop application
* To run, launch command: `./gradlew :desktop:run`
* Or choose **desktop** configuration in IDE and run it.
![desktop-run-configuration.png](desktop-run-configuration.png)
![desktop-run-configuration.png](screenshots/desktop-run-configuration.png)

### Building native desktop distribution
```
Expand Down
4 changes: 2 additions & 2 deletions examples/todoapp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Features:
### Running desktop application
* To run, launch command: `./gradlew :desktop:run`
* Or choose **desktop** configuration in IDE and run it.
![desktop-run-configuration.png](desktop-run-configuration.png)
![desktop-run-configuration.png](screenshots/desktop-run-configuration.png)

#### Building native desktop distribution
```
Expand All @@ -51,7 +51,7 @@ Open project in Intellij IDEA or Android Studio and run "android" configuration.
### Running Web browser application
* To run, launch command: `./gradlew :web:jsBrowserDevelopmentRun`
* Or choose **browser** configuration in IDE and run it.
![browser-run-configuration.png](browser-run-configuration.png)
![browser-run-configuration.png](screenshots/browser-run-configuration.png)

### Running iOS application

Expand Down
2 changes: 1 addition & 1 deletion examples/visual-effects/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ Several visual effects implmented with Compose Multiplatform, used in 1.0 releas
### Running desktop application
* To run, launch command: `./gradlew run`
* Or choose **desktop** configuration in IDE and run it.
![desktop-run-configuration.png](desktop-run-configuration.png)
![desktop-run-configuration.png](screenshots/desktop-run-configuration.png)

4 changes: 2 additions & 2 deletions examples/web-compose-bird/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 🐦 Compose Bird

![](demo.gif)
![](screenshots/demo.gif)

![latestVersion](https://img.shields.io/github/v/release/theapache64/compose-bird)
<a href="https://twitter.com/theapache64" target="_blank">
Expand All @@ -18,7 +18,7 @@

* To run, launch command: `./gradlew jsBrowserRun`
* Or choose **browser** configuration in IDE and run it.
![browser-run-configuration.png](browser-run-configuration.png)
![browser-run-configuration.png](screenshots/browser-run-configuration.png)

## 📦 Distribute

Expand Down
Binary file removed examples/web-compose-bird/cover.jpeg
Binary file not shown.
File renamed without changes
2 changes: 1 addition & 1 deletion examples/web-compose-in-js/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ config.output.library = "MyComposables";
### Running Web browser application
* To run, launch command: `./gradlew :jsBrowserDevelopmentRun`
* Or choose **browser** configuration in IDE and run it.
![browser-run-configuration.png](browser-run-configuration.png)
![browser-run-configuration.png](screenshots/browser-run-configuration.png)

### Building and using the output

Expand Down
4 changes: 2 additions & 2 deletions examples/web-compose-in-js/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import org.jetbrains.compose.compose

plugins {
kotlin("multiplatform") version "1.6.10"
id("org.jetbrains.compose") version "1.0.1"
kotlin("multiplatform")
id("org.jetbrains.compose")
}

group = "me.user"
Expand Down
2 changes: 2 additions & 0 deletions examples/web-compose-in-js/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ kotlin.code.style=official
kotlin.mpp.enableGranularSourceSetsMetadata=true
kotlin.native.enableDependencyPropagation=false
kotlin.js.webpack.major.version=4
kotlin.version=1.7.10
compose.version=1.2.0-beta02
6 changes: 5 additions & 1 deletion examples/web-compose-in-js/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ pluginManagement {
gradlePluginPortal()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}


plugins {
kotlin("multiplatform").version(extra["kotlin.version"] as String)
id("org.jetbrains.compose").version(extra["compose.version"] as String)
}
}
rootProject.name = "web-compose-in-js"

2 changes: 1 addition & 1 deletion examples/web-landing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ Landing page of Compose for Web
### Running Web browser application
* To run, launch command: `./gradlew :jsBrowserRun`
* Or choose **browser** configuration in IDE and run it.
![browser-run-configuration.png](browser-run-configuration.png)
![browser-run-configuration.png](screenshots/browser-run-configuration.png)
2 changes: 1 addition & 1 deletion examples/web-with-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ Here is a good tutorial - [Using packages from NPM](https://play.kotlinlang.org/
### Running web application
* To run, launch command: `./gradlew :jsBrowserRun`
* Or choose **browser** configuration in IDE and run it.
![browser-run-configuration.png](browser-run-configuration.png)
![browser-run-configuration.png](screenshots/browser-run-configuration.png)
2 changes: 1 addition & 1 deletion examples/widgets-gallery/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ demonstrating how to use various Material widgets.
### Running desktop application
* To run, launch command: `./gradlew :desktop:run`
* Or choose **desktop** configuration in IDE and run it.
![desktop-run-configuration.png](desktop-run-configuration.png)
![desktop-run-configuration.png](screenshots/desktop-run-configuration.png)

### Building native desktop distribution
```
Expand Down
15 changes: 15 additions & 0 deletions templates/web-template/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*.iml
.gradle
/local.properties
/.idea
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
build/
/captures
.externalNativeBuild
.cxx
23 changes: 23 additions & 0 deletions templates/web-template/.run/browser.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="browser" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value=":jsBrowserRun" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
</component>
4 changes: 4 additions & 0 deletions templates/web-template/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Compose Web Application

- `./gradlew jsBrowserRun` - run application in a browser
- `./gradlew jsBrowserProductionWebpack` - produce the output in `build/distributions`

0 comments on commit 7bd0b3d

Please sign in to comment.