64
Gradle and build systems for C language 28.4.2014 FI MUNI, Brno Juraj Michálek http://georgik.sinusgear.com

Gradle and build systems for C language

Embed Size (px)

DESCRIPTION

Gradle and build systems for C language. Explaining basics of Gradle on simple examples. How to add support for Visual Studio or Linux package to build.

Citation preview

Page 1: Gradle and build systems for C language

Gradle and build systemsfor C language

28.4.2014FI MUNI, Brno

Juraj Michálekhttp://georgik.sinusgear.com

Page 2: Gradle and build systems for C language

Grab the source codehttps://github.com/georgik/fimuni-c-cpp-examples.git

Page 3: Gradle and build systems for C language

Who am I?

Page 4: Gradle and build systems for C language

SDL

Gradle

CMake

Nuget

Page 5: Gradle and build systems for C language

tiobe.com - programming lang. index

Page 6: Gradle and build systems for C language

Let’s start with something

cool

Page 7: Gradle and build systems for C language

The Battle for Wesnoth

Page 8: Gradle and build systems for C language
Page 9: Gradle and build systems for C language

Multiplatform

SDL officially supports Windows, Mac OS X, Linux, iOS, and Android.

Page 10: Gradle and build systems for C language

SDL versions

1.2 stable - rock solid

2.x development - new features

Page 11: Gradle and build systems for C language

Some basic concepts

Page 12: Gradle and build systems for C language

SDL_init(flags)

SDL_INIT_TIMER - The timer subsystemSDL_INIT_AUDIO - The audio subsystemSDL_INIT_VIDEO - The video subsystemSDL_INIT_CDROM - The cdrom subsystemSDL_INIT_JOYSTICK - The joystick subsystemSDL_INIT_EVERYTHING - All of the aboveSDL_INIT_NOPARACHUTE - Prevents SDL from catching fatal signalsSDL_INIT_EVENTTHREAD - Runs the event manager in a separate thread

Page 13: Gradle and build systems for C language

Quit application

SDL_quit()

Page 14: Gradle and build systems for C language

Window

SDL_CreateWindow("Hello World!", 100, 100, 640, 480, SDL_WINDOW_SHOWN);

Page 15: Gradle and build systems for C language

Load bitmap

SDL_Surface *bmp = NULL;bmp = SDL_LoadBMP("./smajlik.bmp");

Page 16: Gradle and build systems for C language

Visual data

SDL_RendererSDL_Texture

Page 17: Gradle and build systems for C language

Keyboard

SDL_PollEvent(SDL_Event *event)

event.key.keysym.sym

Page 18: Gradle and build systems for C language

Timer

SDL_TimerID SDL_AddTimer( Uint32 interval, SDL_TimerCallback callback, void* param)

Page 19: Gradle and build systems for C language

Mouse

SDL_GetMouseState(*x, *y);

Page 20: Gradle and build systems for C language

Text

Not implemented

Page 21: Gradle and build systems for C language

Extensions

extension for many languages:

C++, Java, Lua, Perl, PHP, Python, Ruby

Page 22: Gradle and build systems for C language

Made with SDL

Page 23: Gradle and build systems for C language

Autiomation Evolved

Page 24: Gradle and build systems for C language

Domain Specific Language

Page 25: Gradle and build systems for C language

gradle tasks

Page 26: Gradle and build systems for C language

build.gradle gradle tasks

gradle hello

Page 27: Gradle and build systems for C language

Plugin system

● focussed functionality is added by plugins● reuse patterns and practices● avoiding boilerplate build code

Page 28: Gradle and build systems for C language

C language plugin

build.gradle

gradle tasks

Page 29: Gradle and build systems for C language

C build executableDirectory structure

build.gradle

Page 30: Gradle and build systems for C language

gradle tasks

gradle mE

Page 31: Gradle and build systems for C language

Linux

Windows

Page 32: Gradle and build systems for C language

Visual Studio plugin

Page 33: Gradle and build systems for C language
Page 34: Gradle and build systems for C language
Page 35: Gradle and build systems for C language
Page 36: Gradle and build systems for C language

Gradle wrapperDownload and prepare infrastructure

Page 37: Gradle and build systems for C language
Page 38: Gradle and build systems for C language

Download SDL2 (for VS)

Page 39: Gradle and build systems for C language
Page 40: Gradle and build systems for C language

Sources

Page 41: Gradle and build systems for C language

Toolchains

Page 42: Gradle and build systems for C language

Helper files for compilers

Page 43: Gradle and build systems for C language

Build Debian/Ubuntu packages

Page 44: Gradle and build systems for C language

Gradle Debian Plugin

https://github.com/gesellix/gradle-debian-plugin.git

Page 45: Gradle and build systems for C language

Further Gradle training

https://github.com/ysoftdevs/gradle-training

Page 46: Gradle and build systems for C language

PyGame

Power of C and Power of Pythonhttp://www.pygame.org

Page 47: Gradle and build systems for C language

Kivy - crossplatform framework for NUI

SDL + PyGamehttp://kivy.org

Page 48: Gradle and build systems for C language
Page 49: Gradle and build systems for C language

Allegro

Page 50: Gradle and build systems for C language
Page 51: Gradle and build systems for C language

Allegro 5.1

Win, Lin, Mac

iOS, Android

http://alleg.sourceforge.net/a5docs/refman/

Page 52: Gradle and build systems for C language

Initialization

al_init();

Page 53: Gradle and build systems for C language

Graphic environment

al_create_display(int w, int h)

Page 54: Gradle and build systems for C language
Page 55: Gradle and build systems for C language

NuGet - http://www.nuget.org

Page 56: Gradle and build systems for C language
Page 57: Gradle and build systems for C language
Page 58: Gradle and build systems for C language

Cppcheck

Page 59: Gradle and build systems for C language

L10N - verify your translations

http://www.microsoft.com/Language

Page 60: Gradle and build systems for C language
Page 61: Gradle and build systems for C language

Continuous integration

Page 62: Gradle and build systems for C language
Page 63: Gradle and build systems for C language

Raspberry Pi

Page 64: Gradle and build systems for C language

Opportunity for innovative students

Bachelor and master thesis @Y Soft

Contact person: [email protected]